summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-01-03 17:14:47 +0000
committertedu <tedu@openbsd.org>2014-01-03 17:14:47 +0000
commit7dec58f2aeb7ec988cc0e7a526cbfd3f6f0c32b8 (patch)
treeac6ec1ea406016fc0355d4b9093be3e4a589f621
parentreplace hand rolled strchr with strchr (diff)
downloadwireguard-openbsd-7dec58f2aeb7ec988cc0e7a526cbfd3f6f0c32b8.tar.xz
wireguard-openbsd-7dec58f2aeb7ec988cc0e7a526cbfd3f6f0c32b8.zip
don't initialize declared variable with a function call
-rw-r--r--usr.bin/signify/signify.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/signify/signify.c b/usr.bin/signify/signify.c
index ff299b241a1..66449b5f718 100644
--- a/usr.bin/signify/signify.c
+++ b/usr.bin/signify/signify.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: signify.c,v 1.10 2014/01/03 17:13:42 tedu Exp $ */
+/* $OpenBSD: signify.c,v 1.11 2014/01/03 17:14:47 tedu Exp $ */
/*
* Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
*
@@ -97,7 +97,9 @@ xmalloc(size_t len)
static void
readall(int fd, void *buf, size_t len, const char *filename)
{
- ssize_t x = read(fd, buf, len);
+ ssize_t x;
+
+ x = read(fd, buf, len);
if (x == -1) {
err(1, "read from %s", filename);
} else if (x != len) {
@@ -153,7 +155,9 @@ readmsg(const char *filename, unsigned long long *msglenp)
static void
writeall(int fd, const void *buf, size_t len, const char *filename)
{
- ssize_t x = write(fd, buf, len);
+ ssize_t x;
+
+ x = write(fd, buf, len);
if (x == -1) {
err(1, "write to %s", filename);
} else if (x != len) {