aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-01-29 21:40:08 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-01-30 14:46:34 +0100
commit494cdea132c9df9cb08eafa1c1c5a0cfeea34c3c (patch)
tree4eb909028debc06e790db3b246a21442a34233a9
parentdevice: let udev know what kind of device we are (diff)
downloadwireguard-monolithic-historical-494cdea132c9df9cb08eafa1c1c5a0cfeea34c3c.tar.xz
wireguard-monolithic-historical-494cdea132c9df9cb08eafa1c1c5a0cfeea34c3c.zip
tools: fread doesn't change errno
Thus we might be responding to an old errno, which could cause this to unnecessarily fail.
-rw-r--r--src/tools/config.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/tools/config.c b/src/tools/config.c
index 5ab6ece..0407b36 100644
--- a/src/tools/config.c
+++ b/src/tools/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);