aboutsummaryrefslogtreecommitdiff
path: root/grp/fgetgrent.c
diff options
context:
space:
mode:
Diffstat (limited to 'grp/fgetgrent.c')
-rw-r--r--grp/fgetgrent.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/grp/fgetgrent.c b/grp/fgetgrent.c
index d2e3de6..245524f 100644
--- a/grp/fgetgrent.c
+++ b/grp/fgetgrent.c
@@ -52,8 +52,8 @@ fgetgrent (FILE *stream)
}
while (buffer != NULL
- && __fgetgrent_r (stream, &resbuf, buffer, buffer_size, &result) != 0
- && errno == ERANGE)
+ && (__fgetgrent_r (stream, &resbuf, buffer, buffer_size, &result)
+ == ERANGE))
{
char *new_buf;
buffer_size += NSS_BUFLEN_GROUP;
@@ -70,10 +70,7 @@ fgetgrent (FILE *stream)
/* Reset the stream. */
if (fsetpos (stream, &pos) != 0)
- {
- buffer = NULL;
- break;
- }
+ buffer = NULL;
}
if (buffer == NULL)