We can use STRNEQ() instead of STRNEQLEN() since we're only
interested in the trailing part of the string.

Signed-off-by: Andrea Bolognani <abolo...@redhat.com>
---
 src/util/virstring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virstring.c b/src/util/virstring.c
index ba36562f85..f23daca0bd 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -1300,7 +1300,7 @@ virStringMatchesNameSuffix(const char *file,
     if (STRNEQLEN(file, name, namelen))
         return false;
 
-    if (STRNEQLEN(file + namelen, suffix, suffixlen))
+    if (STRNEQ(file + namelen, suffix))
         return false;
 
     return true;
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to