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

Diff for /src/usr.bin/file/Attic/softmagic.c between version 1.15 and 1.16

version 1.15, 2009/10/27 23:59:38 version 1.16, 2010/01/17 20:36:21
Line 307 
Line 307 
         size_t len;          size_t len;
         char *copy;          char *copy;
   
         len = strlen(str);          for (len = 0; len < n && str[len]; len++)
         if (len > n)                  continue;
                 len = n;          if ((copy = malloc(len + 1)) == NULL)
         if (!(copy = malloc(len + 1)))                  return NULL;
                 return (NULL);          (void)memcpy(copy, str, len);
         (void) memcpy(copy, str, len + 1);  
         copy[len] = '\0';          copy[len] = '\0';
         return (copy);          return copy;
 }  }
 #endif /* HAVE_STRNDUP */  #endif /* HAVE_STRNDUP */
   

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16