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

Diff for /src/usr.bin/yacc/output.c between version 1.17 and 1.18

version 1.17, 2014/01/08 21:40:25 version 1.18, 2014/01/08 22:36:37
Line 996 
Line 996 
     ++outline;      ++outline;
     fprintf(code_file, "#define YYMAXTOKEN %d\n", max);      fprintf(code_file, "#define YYMAXTOKEN %d\n", max);
   
     symnam = (char **) malloc((max+1)*sizeof(char *));      symnam = (char **) calloc(max+1, sizeof(char *));
     if (symnam == 0) no_space();      if (symnam == 0) no_space();
   
     /* Note that it is  not necessary to initialize the element         */  
     /* symnam[max].                                                     */  
     memset(symnam, 0, max * sizeof(char *));  
     for (i = ntokens - 1; i >= 2; --i)      for (i = ntokens - 1; i >= 2; --i)
         symnam[symbol_value[i]] = symbol_name[i];          symnam[symbol_value[i]] = symbol_name[i];
     symnam[0] = "end-of-file";      symnam[0] = "end-of-file";

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18