From c1d597acbbe1d778d834b362c74390aa458e095d Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Tue, 5 Nov 2024 14:10:23 +0100 Subject: [PATCH] lib/gshadow.c: sgetsgent(): Be consistent using NULL 0 is a horrible null-pointer constant. Don't use it. Especially, when just a few lines above, in the same function, we've used NULL for the same thing. Signed-off-by: Alejandro Colomar --- lib/gshadow.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/gshadow.c b/lib/gshadow.c index 5cdc3abe..bd938899 100644 --- a/lib/gshadow.c +++ b/lib/gshadow.c @@ -14,6 +14,7 @@ #ident "$Id$" +#include #include #include @@ -87,9 +88,9 @@ sgetsgent(const char *string) if (len > sgrbuflen) { char *buf = REALLOC(sgrbuf, len, char); - if (NULL == buf) { + if (NULL == buf) return NULL; - } + sgrbuf = buf; sgrbuflen = len; } @@ -111,7 +112,7 @@ sgetsgent(const char *string) */ if (NULL != cp || i != FIELDS) - return 0; + return NULL; sgroup.sg_name = fields[0]; sgroup.sg_passwd = fields[1];