From: Alejandro Colomar Date: Sat, 18 May 2024 23:00:21 +0000 (+0200) Subject: lib/getdef.c: def_load(): Use stp[c]spn() instead of their patterns X-Git-Tag: 4.17.0-rc1~148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=917469746923d00460c5ca065852553ea294d9d2;p=thirdparty%2Fshadow.git lib/getdef.c: def_load(): Use stp[c]spn() instead of their patterns Signed-off-by: Alejandro Colomar --- diff --git a/lib/getdef.c b/lib/getdef.c index cc635ae73..459fdc99c 100644 --- a/lib/getdef.c +++ b/lib/getdef.c @@ -29,6 +29,8 @@ #include "prototypes.h" #include "shadowlog_internal.h" #include "string/sprintf/xasprintf.h" +#include "string/strchr/stpcspn.h" +#include "string/strchr/stpspn.h" /* @@ -569,16 +571,16 @@ static void def_load (void) /* * Break the line into two fields. */ - name = buf + strspn (buf, " \t"); /* first nonwhite */ + name = stpspn(buf, " \t"); /* first nonwhite */ if (*name == '\0' || *name == '#') continue; /* comment or empty */ - s = name + strcspn (name, " \t"); /* end of field */ + s = stpcspn(name, " \t"); /* end of field */ if (*s == '\0') continue; /* only 1 field?? */ *s++ = '\0'; - value = s + strspn (s, " \"\t"); /* next nonwhite */ + value = stpspn(s, " \"\t"); /* next nonwhite */ *strchrnul(value, '"') = '\0'; /*