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

Diff for /src/usr.bin/file/magic-common.c between version 1.2 and 1.3

version 1.2, 2015/08/11 21:42:16 version 1.3, 2015/08/11 22:29:25
Line 33 
Line 33 
 {  {
         char    *endptr;          char    *endptr;
   
         if (*s == '-')          if (*s == '-' || *s == '\0')
                 return (NULL);                  return (NULL);
   
         errno = 0;          errno = 0;
         *u = strtoull(s, &endptr, 0);          *u = strtoull(s, &endptr, 0);
         if (*s == '\0')          if (endptr == s)
                 return (NULL);                  *u = strtoull(s, &endptr, 16);
         if (errno == ERANGE && *u == ULLONG_MAX)          if (errno == ERANGE && *u == ULLONG_MAX)
                 return (NULL);                  return (NULL);
         if (*endptr == 'L')          if (*endptr == 'L')
Line 51 
Line 52 
 {  {
         char    *endptr;          char    *endptr;
   
         errno = 0;  
         *i = strtoll(s, &endptr, 0);  
         if (*s == '\0')          if (*s == '\0')
                 return (NULL);                  return (NULL);
   
           errno = 0;
           *i = strtoll(s, &endptr, 0);
           if (endptr == s)
                   *i = strtoll(s, &endptr, 16);
         if (errno == ERANGE && *i == LLONG_MAX)          if (errno == ERANGE && *i == LLONG_MAX)
                 return (NULL);                  return (NULL);
         if (*endptr == 'L')          if (*endptr == 'L')

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3