]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
wg: fread doesn't change errno
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 29 Jan 2018 20:40:08 +0000 (21:40 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 30 Jan 2018 13:46:34 +0000 (14:46 +0100)
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>
src/config.c

index 5ab6ece96ee012dbefcbd81a5cf6c4eecec10529..0407b36405151ec8b0c2a39c9c9ec91a8582260f 100644 (file)
@@ -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);