summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/signify/signify.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/signify/signify.c b/usr.bin/signify/signify.c
index 4f21ce845ce..00f17ad7274 100644
--- a/usr.bin/signify/signify.c
+++ b/usr.bin/signify/signify.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: signify.c,v 1.77 2014/05/06 23:33:04 tedu Exp $ */
+/* $OpenBSD: signify.c,v 1.78 2014/05/06 23:50:53 tedu Exp $ */
/*
* Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
*
@@ -544,7 +544,7 @@ verifychecksums(char *msg, int argc, char **argv, int quiet)
char *line, *endline;
struct checksum *checksums = NULL, *c = NULL;
int nchecksums = 0;
- int i, j, uselist, count, hasfailed;
+ int i, j, rv, uselist, count, hasfailed;
int *failures;
line = msg;
@@ -554,10 +554,10 @@ verifychecksums(char *msg, int argc, char **argv, int quiet)
err(1, "realloc");
c = &checksums[nchecksums++];
if ((endline = strchr(line, '\n')))
- *endline++ = 0;
- if (sscanf(line, "%255s %1023s = %1023s",
- c->algo, buf, c->hash) != 3 ||
- buf[0] != '(' || buf[strlen(buf) - 1] != ')')
+ *endline++ = '\0';
+ rv = sscanf(line, "%255s %1023s = %1023s",
+ c->algo, buf, c->hash);
+ if (rv != 3 || buf[0] != '(' || buf[strlen(buf) - 1] != ')')
errx(1, "unable to parse checksum line %s", line);
buf[strlen(buf) - 1] = 0;
strlcpy(c->file, buf + 1, sizeof(c->file));