aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/ipc-uapi.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipc-uapi.h')
-rw-r--r--src/ipc-uapi.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ipc-uapi.h b/src/ipc-uapi.h
index f464be7..d2ba522 100644
--- a/src/ipc-uapi.h
+++ b/src/ipc-uapi.h
@@ -92,8 +92,10 @@ static int userspace_set_device(struct wgdevice *dev)
fprintf(f, "\n");
fflush(f);
- if (fscanf(f, "errno=%d\n\n", &ret) != 1)
+ if (fscanf(f, "errno=%d", &ret) != 1)
ret = errno ? -errno : -EPROTO;
+ if (getc(f) != '\n' || getc(f) != '\n')
+ ret = -EPROTO;
fclose(f);
errno = -ret;
return ret;