From 02d4af7f6f673ab52962d9b7e34f61fa56c14549 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 3 Jul 2024 23:13:18 +0200 Subject: [PATCH] lib/port.c: portcmp(): Use strcmp(3) instead of its pattern Signed-off-by: Alejandro Colomar --- lib/port.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/port.c b/lib/port.c index 136e1ee0..fe25fa9a 100644 --- a/lib/port.c +++ b/lib/port.c @@ -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; }