[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.42 and 1.43

version 1.42, 2014/03/04 16:44:07 version 1.43, 2014/03/05 22:53:36
Line 480 
Line 480 
         char *input, *line, *endline;          char *input, *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, failcount;          int i, j, uselist, count, hasfailed;
         int *failures;          int *failures;
   
         if (!(input = strndup(msg, msglen)))          if (!(input = strndup(msg, msglen)))
Line 510 
Line 510 
                 uselist = 1;                  uselist = 1;
                 count = nchecksums;                  count = nchecksums;
         }          }
         failures = calloc(count, sizeof(int));          if (!(failures = calloc(count, sizeof(int))))
                   err(1, "calloc");
         for (i = 0; i < count; i++) {          for (i = 0; i < count; i++) {
                 if (uselist) {                  if (uselist) {
                         c = &checksums[i];                          c = &checksums[i];
Line 546 
Line 547 
                 if (!quiet)                  if (!quiet)
                         printf("%s: OK\n", c->file);                          printf("%s: OK\n", c->file);
         }          }
         failcount = 0;          hasfailed = 0;
         for (i = 0; i < count; i++) {          for (i = 0; i < count; i++) {
                 if (failures[i]) {                  if (failures[i]) {
                         fprintf(stderr, "%s: FAIL\n",                          fprintf(stderr, "%s: FAIL\n",
                             uselist ? checksums[i].file : argv[i]);                              uselist ? checksums[i].file : argv[i]);
                         failcount++;                          hasfailed = 1;
                 }                  }
         }          }
         if (failcount)          if (hasfailed)
                 exit(1);                  exit(1);
         free(checksums);          free(checksums);
           free(failures);
 }  }
   
 static void  static void

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43