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

Diff for /src/usr.bin/file/Attic/apprentice.c between version 1.32 and 1.33

version 1.32, 2014/10/26 04:10:26 version 1.33, 2015/01/16 08:24:04
Line 30 
Line 30 
  * apprentice - make one pass through /etc/magic, learning its secrets.   * apprentice - make one pass through /etc/magic, learning its secrets.
  */   */
   
 #include <sys/param.h>  
 #include <sys/stat.h>  #include <sys/stat.h>
 #include <sys/types.h>  #include <sys/types.h>
   
Line 73 
Line 73 
 #define MAP_FILE 0  #define MAP_FILE 0
 #endif  #endif
   
 #ifndef MAXPATHLEN  #ifndef PATH_MAX
 #define MAXPATHLEN      1024  #define PATH_MAX        1024
 #endif  #endif
   
 struct magic_entry {  struct magic_entry {
Line 620 
Line 620 
         int errs = 0;          int errs = 0;
         struct magic_entry *marray;          struct magic_entry *marray;
         uint32_t marraycount, i, mentrycount = 0, starttest;          uint32_t marraycount, i, mentrycount = 0, starttest;
         char subfn[MAXPATHLEN];          char subfn[PATH_MAX];
         struct stat st;          struct stat st;
         DIR *dir;          DIR *dir;
         struct dirent *d;          struct dirent *d;
Line 2034 
Line 2034 
         }          }
   
         (void)asprintf(buf, "%s%s", fn, ext);          (void)asprintf(buf, "%s%s", fn, ext);
         if (*buf && strlen(*buf) > MAXPATHLEN) {          if (*buf && strlen(*buf) > PATH_MAX) {
                 free(*buf);                  free(*buf);
                 *buf = NULL;                  *buf = NULL;
         }          }

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33