diff options
Diffstat (limited to 'lib/libc/gen/getgrent.c')
-rw-r--r-- | lib/libc/gen/getgrent.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c index 9ba9a71..6451dc9 100644 --- a/lib/libc/gen/getgrent.c +++ b/lib/libc/gen/getgrent.c @@ -163,7 +163,7 @@ start_gr() char *line; size_t linelen; _gr_yp_enabled = 0; - while(line = fgetln(_gr_fp, &linelen)) { + while((line = fgetln(_gr_fp, &linelen)) != NULL) { if(line[0] == '+') { if(line[1] && !_gr_yp_enabled) { _gr_yp_enabled = 1; @@ -301,6 +301,7 @@ grscan(search, gid, name) return(1); } /* NOTREACHED */ + return (0); } #ifdef YP @@ -425,7 +426,8 @@ unpack: strcpy(resultbuf, result); free(result); - if(result = strchr(resultbuf, '\n')) *result = '\0'; + if((result = strchr(resultbuf, '\n')) != NULL) + *result = '\0'; if (_gr_breakout_yp(gr, resultbuf)) return(1); else |