summaryrefslogtreecommitdiff
path: root/src/passwd/getpw_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/passwd/getpw_r.c')
-rw-r--r--src/passwd/getpw_r.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/passwd/getpw_r.c b/src/passwd/getpw_r.c
index 0e71e43f..e8cc811e 100644
--- a/src/passwd/getpw_r.c
+++ b/src/passwd/getpw_r.c
@@ -13,11 +13,11 @@ static int getpw_r(const char *name, uid_t uid, struct passwd *pw, char *buf, si
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs);
rv = __getpw_a(name, uid, pw, &line, &len, res);
- if (!rv && size < len) {
+ if (*res && size < len) {
*res = 0;
rv = ERANGE;
}
- if (!rv) {
+ if (*res) {
memcpy(buf, line, len);
FIX(name);
FIX(passwd);