[PATCH 13/13] vboxDumpDisplay: remove suspicious strlen

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

 



The return type of strlen is 'size_t', which is unsigned and therefore
never less than zero.

Use STREQ to make the check obvious.
---
 src/vbox/vbox_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index 71fc62b..0c0dc96 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -3336,7 +3336,7 @@ vboxDumpDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
             VBOX_UTF16_TO_UTF8(valueDisplayUtf16, &valueDisplayUtf8);
             VBOX_UTF16_FREE(valueDisplayUtf16);
 
-            if (strlen(valueDisplayUtf8) <= 0)
+            if (STREQ(valueDisplayUtf8, ""))
                 VBOX_UTF8_FREE(valueDisplayUtf8);
         }
 
-- 
2.4.10

--
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]