From: Alejandro Colomar Date: Tue, 5 Nov 2024 13:10:23 +0000 (+0100) Subject: lib/gshadow.c: sgetsgent(): Be consistent using NULL X-Git-Tag: 4.17.0-rc1~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c1d597acbbe1d778d834b362c74390aa458e095d;p=thirdparty%2Fshadow.git 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 --- diff --git a/lib/gshadow.c b/lib/gshadow.c index 5cdc3abe5..bd9388995 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];