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

Diff for /src/usr.bin/find/misc.c between version 1.13 and 1.14

version 1.13, 2015/07/14 16:16:07 version 1.14, 2015/07/14 16:58:22
Line 60 
Line 60 
         for (p = *store; (ch = *orig); ++orig)          for (p = *store; (ch = *orig); ++orig)
                 if (ch == '{' && orig[1] == '}') {                  if (ch == '{' && orig[1] == '}') {
                         while ((p - *store) + plen > len) {                          while ((p - *store) + plen > len) {
                                 int newlen = len * 2;  
                                 char *newstore;                                  char *newstore;
   
                                 if (!(newstore = realloc(*store, newlen)))                                  newstore = reallocarray(*store, len, 2);
                                   if (newstore == NULL)
                                         err(1, NULL);                                          err(1, NULL);
                                 p = (p - *store) + newstore;                                  p = (p - *store) + newstore;
                                 *store = newstore;                                  *store = newstore;
                                 len = newlen;                                  len *= 2;
                         }                          }
                         memmove(p, path, plen);                          memmove(p, path, plen);
                         p += plen;                          p += plen;

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14