=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/error/Attic/filter.c,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** src/usr.bin/error/Attic/filter.c 1999/08/06 20:41:07 1.4 --- src/usr.bin/error/Attic/filter.c 1999/12/04 00:16:52 1.5 *************** *** 1,4 **** ! /* $OpenBSD: filter.c,v 1.4 1999/08/06 20:41:07 deraadt Exp $ */ /* $NetBSD: filter.c,v 1.3 1995/09/02 06:15:28 jtc Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: filter.c,v 1.5 1999/12/04 00:16:52 deraadt Exp $ */ /* $NetBSD: filter.c,v 1.3 1995/09/02 06:15:28 jtc Exp $ */ /* *************** *** 38,47 **** #if 0 static char sccsid[] = "@(#)filter.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: filter.c,v 1.4 1999/08/06 20:41:07 deraadt Exp $"; #endif /* not lint */ ! #include #include #include #include --- 38,47 ---- #if 0 static char sccsid[] = "@(#)filter.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: filter.c,v 1.5 1999/12/04 00:16:52 deraadt Exp $"; #endif /* not lint */ ! #include #include #include #include *************** *** 70,76 **** FILE *fyle; char inbuffer[256]; uid_t uid; ! char filename[128]; char *username; struct passwd *passwdentry; --- 70,76 ---- FILE *fyle; char inbuffer[256]; uid_t uid; ! char filename[MAXPATHLEN]; char *username; struct passwd *passwdentry; *************** *** 86,95 **** if ( (passwdentry = (struct passwd *)getpwnam(username)) == NULL) return; } ! strcpy(filename, passwdentry->pw_dir); ! (void)strcat(filename, ERRORNAME); } else ! (void)strcpy(filename, auxname); #ifdef FULLDEBUG printf("Opening file \"%s\" to read names to ignore.\n", filename); --- 86,95 ---- if ( (passwdentry = (struct passwd *)getpwnam(username)) == NULL) return; } ! strlcpy(filename, passwdentry->pw_dir, sizeof(filename)); ! (void)strlcat(filename, ERRORNAME, sizeof(filename)); } else ! (void)strlcpy(filename, auxname, sizeof filename); #ifdef FULLDEBUG printf("Opening file \"%s\" to read names to ignore.\n", filename); *************** *** 103,109 **** /* * Make the first pass through the file, counting lines */ ! for (nignored = 0; fgets(inbuffer, 255, fyle) != NULL; nignored++) continue; names_ignored = (char **)Calloc(nignored+1, sizeof (char *)); fclose(fyle); --- 103,110 ---- /* * Make the first pass through the file, counting lines */ ! for (nignored = 0; ! fgets(inbuffer, sizeof(inbuffer)-1, fyle) != NULL; nignored++) continue; names_ignored = (char **)Calloc(nignored+1, sizeof (char *)); fclose(fyle); *************** *** 114,120 **** nignored = 0; return; } ! for (i=0; i < nignored && (fgets (inbuffer, 255, fyle) != NULL); i++){ names_ignored[i] = strsave(inbuffer); (void)substitute(names_ignored[i], '\n', '\0'); } --- 115,122 ---- nignored = 0; return; } ! for (i=0; i < nignored && ! (fgets (inbuffer, sizeof(inbuffer)-1, fyle) != NULL); i++){ names_ignored[i] = strsave(inbuffer); (void)substitute(names_ignored[i], '\n', '\0'); }