Set *RESULT to NULL before returning error.
authordrepper <drepper>
Mon, 21 Apr 1997 11:30:48 +0000 (11:30 +0000)
committerdrepper <drepper>
Mon, 21 Apr 1997 11:30:48 +0000 (11:30 +0000)
shadow/fgetspent_r.c

index 4614b51..403eecf 100644 (file)
@@ -42,7 +42,10 @@ __fgetspent_r (FILE *stream, struct spwd *resbuf, char *buffer, size_t buflen,
     {
       p = fgets (buffer, buflen, stream);
       if (p == NULL)
-       return errno;
+       {
+         *result = NULL;
+         return errno;
+       }
 
       /* Skip leading blanks.  */
       while (isspace (*p))