]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/port.c: portcmp(): Use strcmp(3) instead of its pattern
authorAlejandro Colomar <alx@kernel.org>
Wed, 3 Jul 2024 21:13:18 +0000 (23:13 +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>
lib/port.c

index 136e1ee0f611adee59aa2b272b4c2843afeb074f..fe25fa9aface71b73b7caace4b9d428193676dfe 100644 (file)
@@ -46,9 +46,8 @@ static int portcmp (const char *pattern, const char *port)
        if (('\0' == *pattern) && ('\0' == *port)) {
                return 0;
        }
-       if (('S' == orig[0]) && ('U' == orig[1]) && ('\0' == orig[2])) {
+       if (strcmp(orig, "SU") == 0)
                return 1;
-       }
 
        return (*pattern == '*') ? 0 : 1;
 }