aboutsummaryrefslogtreecommitdiff
path: root/shadow/sgetspent_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'shadow/sgetspent_r.c')
-rw-r--r--shadow/sgetspent_r.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/shadow/sgetspent_r.c b/shadow/sgetspent_r.c
index fb7d0158d9..8aa5a9bdc1 100644
--- a/shadow/sgetspent_r.c
+++ b/shadow/sgetspent_r.c
@@ -90,8 +90,9 @@ int
__sgetspent_r (const char *string, struct spwd *resbuf, char *buffer,
size_t buflen, struct spwd **result)
{
- *result = parse_line (strncpy (buffer, string, buflen), resbuf, NULL, 0)
- ? resbuf : NULL;
+ int parse_result = parse_line (strncpy (buffer, string, buflen),
+ resbuf, NULL, 0);
+ *result = parse_result > 0 ? resbuf : NULL;
return *result == NULL ? errno : 0;
}