diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-01-29 21:40:08 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-01-30 14:46:34 +0100 |
commit | 1e5d6b9a661750133a1d0dc4729847c9b52ce97a (patch) | |
tree | 5ac42356636f0d87d503fb656d8038d23643b26b /src/config.c | |
parent | contrib: keygen-html: share curve25519 implementation with kernel (diff) | |
download | wireguard-tools-1e5d6b9a661750133a1d0dc4729847c9b52ce97a.tar.xz wireguard-tools-1e5d6b9a661750133a1d0dc4729847c9b52ce97a.zip |
wg: fread doesn't change errno
Thus we might be responding to an old errno, which could cause this to
unnecessarily fail.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/src/config.c b/src/config.c index 5ab6ece..0407b36 100644 --- a/src/config.c +++ b/src/config.c @@ -128,10 +128,6 @@ static bool parse_keyfile(uint8_t key[static WG_KEY_LEN], const char *path) } if (fread(dst, WG_KEY_LEN_BASE64 - 1, 1, f) != 1) { - if (errno) { - perror("fread"); - goto out; - } /* If we're at the end and we didn't read anything, we're /dev/null or an empty file. */ if (!ferror(f) && feof(f) && !ftell(f)) { memset(key, 0, WG_KEY_LEN); |