lib/sgetgrent.c: change to warn when data remains

This commit is contained in:
ed@s5h.net 2019-08-22 18:18:31 +01:00 committed by Serge Hallyn
parent 558977bb2b
commit 1cbb562c23

View File

@ -136,7 +136,7 @@ struct group *sgetgrent (const char *buf)
cp++;
}
}
if (i < (NFIELDS - 1) || *grpfields[2] == '\0') {
if (i < (NFIELDS - 1) || *grpfields[2] == '\0' || cp != NULL) {
return (struct group *) 0;
}
grent.gr_name = grpfields[0];