]> xenbits.xensource.com Git - libvirt.git/commitdiff
internal: Use g_strcmp0 in STR(N)EQ_NULLABLE
authorPeter Krempa <pkrempa@redhat.com>
Thu, 24 Oct 2019 14:06:19 +0000 (16:06 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 24 Oct 2019 17:35:34 +0000 (19:35 +0200)
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/internal.h

index 5b0a2335f53a781d027340ebd9efceea8c8cb98e..0ff9f496ace62e436bf2392488e0bfa5a30b967d 100644 (file)
 #define STRCASEPREFIX(a, b) (c_strncasecmp(a, b, strlen(b)) == 0)
 #define STRSKIP(a, b) (STRPREFIX(a, b) ? (a) + strlen(b) : NULL)
 
-#define STREQ_NULLABLE(a, b) \
-    ((a) ? (b) && STREQ((a), (b)) : !(b))
-#define STRNEQ_NULLABLE(a, b) \
-    ((a) ? !(b) || STRNEQ((a), (b)) : !!(b))
+#define STREQ_NULLABLE(a, b) (g_strcmp0(a, b) == 0)
+#define STRNEQ_NULLABLE(a, b) (g_strcmp0(a, b) != 0)
 
 #define NUL_TERMINATE(buf) do { (buf)[sizeof(buf)-1] = '\0'; } while (0)