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

Diff for /src/usr.bin/diff/xmalloc.c between version 1.6 and 1.7

version 1.6, 2015/04/29 04:00:25 version 1.7, 2015/06/17 20:50:10
Line 73 
Line 73 
 char *  char *
 xstrdup(const char *str)  xstrdup(const char *str)
 {  {
         size_t len;  
         char *cp;          char *cp;
   
         len = strlen(str) + 1;          if ((cp = strdup(str)) == NULL)
         cp = xmalloc(len);                  err(1, "xstrdup");
         strlcpy(cp, str, len);  
         return cp;          return cp;
 }  }
   

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7