about summary refs log tree commit diff
path: root/shadow/sgetspent_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'shadow/sgetspent_r.c')
-rw-r--r--shadow/sgetspent_r.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/shadow/sgetspent_r.c b/shadow/sgetspent_r.c
index 407886ede4..5270a2a163 100644
--- a/shadow/sgetspent_r.c
+++ b/shadow/sgetspent_r.c
@@ -68,11 +68,13 @@ LINE_PARSER
 
 
 /* Read one shadow entry from the given stream.  */
-struct spwd *
-__sgetspent_r (const char *string, struct spwd *result, char *buffer,
-	       int buflen)
+int
+__sgetspent_r (const char *string, struct spwd *resbuf, char *buffer,
+	       size_t buflen, struct spwd **result)
 {
-  return parse_line (strncpy (buffer, string, buflen), result, NULL, 0)
-    ? result : NULL;
+  *result = parse_line (strncpy (buffer, string, buflen), resbuf, NULL, 0)
+    ? resbuf : NULL;
+
+  return *result == NULL ? errno : 0;
 }
 weak_alias (__sgetspent_r, sgetspent_r)