One line fix to silently ignore entries that start with a '+' or '-'.

This prevents yp_mkdb from adding magic NIS entries to NIS maps themselves.
This commit is contained in:
Bill Paul 1995-03-31 19:45:13 +00:00
parent bbf437ee54
commit 4f93d7d4de
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7538

View file

@ -20,7 +20,7 @@
*/
/*
* $Id$
* $Id: yp_mkdb.c,v 1.1 1995/01/31 08:43:07 wpaul Exp $
*/
#define BUFFERSIZE 4096
@ -151,6 +151,7 @@ load( char *FileName, char *DbName)
fgets(Buffer, BUFFERSIZE, infile);
if (feof(infile)) break;
if (Buffer[0] == '+' || Buffer[0] == '-') break;
r=strlen(Buffer)-1;
if (Buffer[r]!='\n' && r>=BUFFERSIZE) {
fprintf(stderr, "%s: Buffer overflow\n", FileName);