]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
string-util: use strneq
authorMike Yuan <me@yhndnzj.com>
Thu, 4 Jan 2024 08:48:42 +0000 (16:48 +0800)
committerMike Yuan <me@yhndnzj.com>
Thu, 4 Jan 2024 08:49:05 +0000 (16:49 +0800)
src/basic/string-util.c

index f6453990bd9e9b73edd02b2e639dcef3c7be2b04..3c34d6b455aca66faf99b29c9001ae9f85d8e697 100644 (file)
@@ -1537,7 +1537,7 @@ char *strrstr(const char *haystack, const char *needle) {
                 return strchr(haystack, 0);
 
         for (const char *p = haystack; *p; p++)
-                if (strncmp(p, needle, l) == 0)
+                if (strneq(p, needle, l))
                         f = p;
 
         return (char*) f;