summary refs log tree commit diff
path: root/nss/getXXent.c
diff options
context:
space:
mode:
Diffstat (limited to 'nss/getXXent.c')
-rw-r--r--nss/getXXent.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/nss/getXXent.c b/nss/getXXent.c
index ecf7eadc4c..7e291e6298 100644
--- a/nss/getXXent.c
+++ b/nss/getXXent.c
@@ -51,15 +51,22 @@ Boston, MA 02111-1307, USA.  */
 #endif
 
 /* Prototype of the reentrant version.  */
-LOOKUP_TYPE *INTERNAL (REENTRANT_GETNAME) (LOOKUP_TYPE *result, char *buffer,
-					   int buflen H_ERRNO_PARM);
+extern int INTERNAL (REENTRANT_GETNAME) (LOOKUP_TYPE *resbuf, char *buffer,
+					 size_t buflen, LOOKUP_TYPE **result
+					 H_ERRNO_PARM);
 
 
 LOOKUP_TYPE *
 GETFUNC_NAME (void)
 {
   static char buffer[BUFLEN];
-  static LOOKUP_TYPE result;
+  static LOOKUP_TYPE resbuf;
+  LOOKUP_TYPE *result;
 
-  return INTERNAL (REENTRANT_GETNAME) (&result, buffer, BUFLEN H_ERRNO_VAR);
+  if (INTERNAL (REENTRANT_GETNAME) (&resbuf, buffer, BUFLEN, &result
+				    H_ERRNO_VAR) != 0)
+    /* Errors occured.  */
+    return NULL;
+
+  return result;
 }