[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.5 and 1.6

version 1.5, 1998/07/10 15:05:13 version 1.6, 1998/08/19 17:20:01
Line 183 
Line 183 
   
 #define ALLOC_INCR      20  #define ALLOC_INCR      20
         if (nd+1 >= maxmagic){          if (nd+1 >= maxmagic){
               struct magic *mtmp;
   
             maxmagic += ALLOC_INCR;              maxmagic += ALLOC_INCR;
             if ((magic = (struct magic *) realloc(magic,              if ((mtmp = (struct magic *) realloc(magic,
                                                   sizeof(struct magic) *                                                    sizeof(struct magic) *
                                                   maxmagic)) == NULL) {                                                    maxmagic)) == NULL) {
                 warn("malloc");                  warn("malloc");
                 if (check)                  if (check) {
                           if (magic)
                                   free(magic);
                           magic = mtmp;
                         return -1;                          return -1;
                 else                  } else
                         exit(1);                          exit(1);
             }              }
             memset(&magic[*ndx], 0, sizeof(struct magic) * ALLOC_INCR);              memset(&magic[*ndx], 0, sizeof(struct magic) * ALLOC_INCR);

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