diff options
Diffstat (limited to 'grp/fgetgrent.c')
-rw-r--r-- | grp/fgetgrent.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/grp/fgetgrent.c b/grp/fgetgrent.c index 95ae2ec..66dd305 100644 --- a/grp/fgetgrent.c +++ b/grp/fgetgrent.c @@ -25,7 +25,11 @@ struct group * fgetgrent (FILE *stream) { static char buffer[BUFSIZ]; - static struct group result; + static struct group resbuf; + struct group *result; - return __fgetgrent_r (stream, &result, buffer, sizeof buffer); + if (__fgetgrent_r (stream, &resbuf, buffer, sizeof buffer, &result) != 0) + return NULL; + + return result; } |