lib/port.c: portcmp(): Use strcmp(3) instead of its pattern

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2024-07-03 23:13:18 +02:00
committed by Serge Hallyn
parent f45adadd28
commit 02d4af7f6f
+1 -2
View 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;
}