diff options
Diffstat (limited to 'libc/pwd_grp/pwent.c')
-rw-r--r-- | libc/pwd_grp/pwent.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libc/pwd_grp/pwent.c b/libc/pwd_grp/pwent.c index f70a6e378..51d2fba96 100644 --- a/libc/pwd_grp/pwent.c +++ b/libc/pwd_grp/pwent.c @@ -65,12 +65,14 @@ void endpwent(void) } int getpwent_r (struct passwd *password, char *buff, - size_t buflen, struct passwd **crap) + size_t buflen, struct passwd **result) { int ret; LOCK; + *result = NULL; if (pw_fd != -1 && (ret=__getpwent_r(password, buff, buflen, pw_fd)) == 0) { UNLOCK; + *result = password; return 0; } UNLOCK; @@ -83,8 +85,9 @@ struct passwd *getpwent(void) int ret; static char line_buff[PWD_BUFFER_SIZE]; static struct passwd pwd; + struct passwd *result; - if ((ret=getpwent_r(&pwd, line_buff, sizeof(line_buff), NULL)) == 0) { + if ((ret=getpwent_r(&pwd, line_buff, sizeof(line_buff), &result)) == 0) { return &pwd; } __set_errno(ret); |