[PATCH 4/7] util: Tweak virStringHasSuffix()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make it more similar to virStringStripSuffix(), which also
results in types being more correct since STRNEQ() returns
int rather than bool.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/util/virstring.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/util/virstring.c b/src/util/virstring.c
index f669d59f58..a938669b63 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -1245,7 +1245,10 @@ virStringHasSuffix(const char *str,
     if (len < suffixlen)
         return false;
 
-    return STREQ(str + len - suffixlen, suffix);
+    if (STRNEQ(str + len - suffixlen, suffix))
+        return false;
+
+    return true;
 }
 
 bool
-- 
2.20.1

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux