[BACK]Return to signify.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / signify

Diff for /src/usr.bin/signify/signify.c between version 1.77 and 1.78

version 1.77, 2014/05/06 23:33:04 version 1.78, 2014/05/06 23:50:53
Line 544 
Line 544 
         char *line, *endline;          char *line, *endline;
         struct checksum *checksums = NULL, *c = NULL;          struct checksum *checksums = NULL, *c = NULL;
         int nchecksums = 0;          int nchecksums = 0;
         int i, j, uselist, count, hasfailed;          int i, j, rv, uselist, count, hasfailed;
         int *failures;          int *failures;
   
         line = msg;          line = msg;
Line 554 
Line 554 
                         err(1, "realloc");                          err(1, "realloc");
                 c = &checksums[nchecksums++];                  c = &checksums[nchecksums++];
                 if ((endline = strchr(line, '\n')))                  if ((endline = strchr(line, '\n')))
                         *endline++ = 0;                          *endline++ = '\0';
                 if (sscanf(line, "%255s %1023s = %1023s",                  rv = sscanf(line, "%255s %1023s = %1023s",
                     c->algo, buf, c->hash) != 3 ||                      c->algo, buf, c->hash);
                     buf[0] != '(' || buf[strlen(buf) - 1] != ')')                  if (rv != 3 || buf[0] != '(' || buf[strlen(buf) - 1] != ')')
                         errx(1, "unable to parse checksum line %s", line);                          errx(1, "unable to parse checksum line %s", line);
                 buf[strlen(buf) - 1] = 0;                  buf[strlen(buf) - 1] = 0;
                 strlcpy(c->file, buf + 1, sizeof(c->file));                  strlcpy(c->file, buf + 1, sizeof(c->file));

Legend:
Removed from v.1.77  
changed lines
  Added in v.1.78