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

Diff for /src/usr.bin/uniq/uniq.c between version 1.12 and 1.13

version 1.12, 2002/12/08 22:43:54 version 1.13, 2003/04/05 16:17:26
Line 226 
Line 226 
                  * Digit signifies an old-style option.  Malloc space for dash,                   * Digit signifies an old-style option.  Malloc space for dash,
                  * new option and argument.                   * new option and argument.
                  */                   */
                 len = strlen(ap);                  len = strlen(ap) + 3;
                 if ((start = p = malloc(len + 3)) == NULL)                  if ((start = p = malloc(len)) == NULL)
                         err(1, "malloc");                          err(1, "malloc");
                 *p++ = '-';                  *p++ = '-';
                 *p++ = ap[0] == '+' ? 's' : 'f';                  *p++ = ap[0] == '+' ? 's' : 'f';
                 (void)strcpy(p, ap + 1);                  (void)strlcpy(p, ap + 1, len - 2);
                 *argv = start;                  *argv = start;
         }          }
 }  }

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