]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
src/suauth.c: check_su_auth(): Use strspn(3) instead of its pattern
authorAlejandro Colomar <alx@kernel.org>
Wed, 3 Jul 2024 21:46:50 +0000 (23:46 +0200)
committerSerge Hallyn <serge@hallyn.com>
Mon, 14 Oct 2024 01:40:02 +0000 (20:40 -0500)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/suauth.c

index 9def76c0ed049726c5b8285447fc174145614ee4..895f1278ba834ec8e44c581702fa6c91ca9db37f 100644 (file)
@@ -84,9 +84,7 @@ int check_su_auth (const char *actual_id,
 
                stpcpy(strrspn(temp, " \t"), "");
 
-               posn = 0;
-               while (temp[posn] == ' ' || temp[posn] == '\t')
-                       posn++;
+               posn = strspn(temp, " \t");
 
                if (temp[posn] == '#' || temp[posn] == '\0') {
                        continue;