summaryrefslogtreecommitdiff
path: root/usr.bin/signify/signify.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-05-06 23:50:54 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-05-06 23:50:54 +0000
commitbad9af68a3f945f235929d5de9eaf49d67976ecb (patch)
treec3d793e9f51939ca85ed1d0e5c52b41bcf08fe92 /usr.bin/signify/signify.c
parentfe1b62da99e5860e4645fdcf0e7bff02651e12d5 (diff)
temp variable for a bit of clarity
Diffstat (limited to 'usr.bin/signify/signify.c')
-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));