boyce@daemen.UUCP (Doug Boyce) (08/03/85)
We run 4.2 and it wouldn't even compile, "tim" wasn't defined, "tocname" was labeled "cname". Then it would compile because in the function basename there is an unnecessary 'index' variable that got confused with the preprocessor changing 'strchr' to 'index'. So when it finally compiled it would always give a nice core a present, it turned out to an undefined pointer sent to 'fprintf'. There were also a lot of extraneous variables. Use patch(1) and enjoy. diff cpg.c.old cpg.c ---------------------Don't-eat-me-I'm-just-a-decoy------------------------------ 19a20,22 > #ifdef BSD > #include <sys/time.h> > #else BSD 20a24 > #endif 74c78 < char cname[] = "/tmp/toc_XXXXXX"; --- > char tocname[] = "/tmp/toc_XXXXXX"; 118c122 < struct tm *localtime (); --- > struct tm *localtime (), *tim; 130c134 < exit(); --- > exit(1); 133a138 > tocfile=stdout; 151c156 < exit(); --- > exit(2); 274d278 < register int i; /* temporary */ 283,284d286 < register char *p; /* temporary char pointer */ < 329c331 < header (&lineno, line, fd); --- > header (&lineno, line); 376c378 < header (lineno, line, fd) --- > header (lineno, line) 379d380 < register FILE *fd; 381d381 < register char *p; 648d647 < char buf[80]; 654,655d652 < char outline[80]; < 743d739 < register int Cnt; 745d740 < register int result; 748,749d742 < static char *_fnm = "ckfunc"; < 757c750 < p = &FunctionName; --- > p = FunctionName; 774c767 < if (result = strcmp (FunctionName, ReservedWord[i])) --- > if (strcmp (FunctionName, ReservedWord[i])) 819d811 < register int index; 825c817,818 < if(mid=strchr(ret,';'))*mid='\0'; --- > if(mid = strchr(ret,';')) > *mid='\0';