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

Diff for /src/usr.bin/unifdef/unifdef.c between version 1.28 and 1.29

version 1.28, 2016/03/15 01:00:17 version 1.29, 2017/04/02 02:51:51
Line 1530 
Line 1530 
 astrcat(const char *s1, const char *s2)  astrcat(const char *s1, const char *s2)
 {  {
         char *s;          char *s;
         int len;  
         size_t size;  
   
         len = snprintf(NULL, 0, "%s%s", s1, s2);          if (asprintf(&s, "%s%s", s1, s2) < 0)
         if (len < 0)                  err(2, "asprintf");
                 err(2, "snprintf");  
         size = (size_t)len + 1;  
         s = (char *)malloc(size);  
         if (s == NULL)  
                 err(2, "malloc");  
         snprintf(s, size, "%s%s", s1, s2);  
         return (s);          return (s);
 }  }
   

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29