[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.88 and 1.89

version 1.88, 2014/05/16 18:35:01 version 1.89, 2014/05/30 21:17:42
Line 120 
Line 120 
 {  {
         void *p;          void *p;
   
         p = malloc(len);          if (!(p = malloc(len)))
         if (!p)  
                 err(1, "malloc %zu", len);                  err(1, "malloc %zu", len);
         return p;          return p;
 }  }
Line 143 
Line 142 
                     COMMENTMAXLEN) >= COMMENTMAXLEN)                      COMMENTMAXLEN) >= COMMENTMAXLEN)
                         errx(1, "comment too long");                          errx(1, "comment too long");
         }          }
         b64end = strchr(commentend + 1, '\n');          if (!(b64end = strchr(commentend + 1, '\n')))
         if (!b64end)  
                 errx(1, "missing new line after base64 in %s", filename);                  errx(1, "missing new line after base64 in %s", filename);
         *b64end = '\0';          *b64end = '\0';
         if (b64_pton(commentend + 1, buf, buflen) != buflen)          if (b64_pton(commentend + 1, buf, buflen) != buflen)
Line 161 
Line 159 
         int rv, fd;          int rv, fd;
   
         fd = xopen(filename, O_RDONLY | O_NOFOLLOW, 0);          fd = xopen(filename, O_RDONLY | O_NOFOLLOW, 0);
         rv = read(fd, b64, sizeof(b64) - 1);          if ((rv = read(fd, b64, sizeof(b64) - 1)) == -1)
         if (rv == -1)  
                 err(1, "read from %s", filename);                  err(1, "read from %s", filename);
         b64[rv] = '\0';          b64[rv] = '\0';
         parseb64file(filename, b64, buf, buflen, comment);          parseb64file(filename, b64, buf, buflen, comment);
Line 219 
Line 216 
         ssize_t x;          ssize_t x;
   
         while (buflen != 0) {          while (buflen != 0) {
                 x = write(fd, buf, buflen);                  if ((x = write(fd, buf, buflen)) == -1)
                 if (x == -1)  
                         err(1, "write to %s", filename);                          err(1, "write to %s", filename);
                 buflen -= x;                  buflen -= x;
                 buf = (char *)buf + x;                  buf = (char *)buf + x;
Line 548 
Line 544 
 {  {
         void *p;          void *p;
   
         p = calloc(s1, s2);          if (!(p = calloc(s1, s2)))
         if (!p)  
                 err(1, "calloc");                  err(1, "calloc");
         return p;          return p;
 }  }

Legend:
Removed from v.1.88  
changed lines
  Added in v.1.89