From 2dd83db07b08c7791154df8a7d8d20449dd471b6 Mon Sep 17 00:00:00 2001 From: tedu Date: Tue, 6 May 2014 23:50:53 +0000 Subject: [PATCH] temp variable for a bit of clarity --- usr.bin/signify/signify.c | 12 ++++++------ 1 file 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 * @@ -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)); -- 2.20.1