From e208d0d6271ac11654950da7f7f3bbfe31e9a240 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sat, 8 Feb 2025 11:06:40 +0100 Subject: [PATCH] lib/nss.c: Use !strcaseprefix() instead of its pattern Signed-off-by: Alejandro Colomar --- lib/nss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/nss.c b/lib/nss.c index a2eb9e006..d97e0709c 100644 --- a/lib/nss.c +++ b/lib/nss.c @@ -15,6 +15,7 @@ #include "shadowlog_internal.h" #include "shadowlog.h" #include "string/sprintf/snprintf.h" +#include "string/strcmp/strcaseprefix.h" #include "string/strcmp/streq.h" #include "string/strcmp/strprefix.h" #include "string/strspn/stpspn.h" @@ -84,7 +85,7 @@ nss_init(const char *nsswitch_path) { continue; if (strlen(line) < 8) continue; - if (strncasecmp(line, "subid:", 6) != 0) + if (!strcaseprefix(line, "subid:")) continue; p = &line[6]; p = stpspn(p, " \t\n"); -- 2.47.2