[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.7 and 1.8

version 1.7, 1998/08/21 04:25:02 version 1.8, 1999/09/26 20:47:28
Line 52 
Line 52 
 static void eatsize     __P((char **));  static void eatsize     __P((char **));
   
 static int maxmagic = 0;  static int maxmagic = 0;
   static int alloc_incr = 256;
   
 static int apprentice_1 __P((char *, int));  static int apprentice_1 __P((char *, int));
   
Line 181 
Line 182 
         struct magic *m;          struct magic *m;
         char *t, *s;          char *t, *s;
   
 #define ALLOC_INCR      20  
         if (nd+1 >= maxmagic){          if (nd+1 >= maxmagic){
             struct magic *mtmp;              struct magic *mtmp;
   
             maxmagic += ALLOC_INCR;              maxmagic += alloc_incr;
             if ((mtmp = (struct magic *) realloc(magic,              if ((mtmp = (struct magic *) realloc(magic,
                                                   sizeof(struct magic) *                                                    sizeof(struct magic) *
                                                   maxmagic)) == NULL) {                                                    maxmagic)) == NULL) {
Line 198 
Line 198 
                         exit(1);                          exit(1);
             }              }
             magic = mtmp;              magic = mtmp;
             memset(&magic[*ndx], 0, sizeof(struct magic) * ALLOC_INCR);              memset(&magic[*ndx], 0, sizeof(struct magic) * alloc_incr);
               alloc_incr *= 2;
         }          }
         m = &magic[*ndx];          m = &magic[*ndx];
         m->flag = 0;          m->flag = 0;

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8