From 27bab9cac4765e21876722f27bcbcf0745e02af7 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 24 Oct 2019 16:06:19 +0200 Subject: [PATCH] internal: Use g_strcmp0 in STR(N)EQ_NULLABLE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/internal.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/internal.h b/src/internal.h index 5b0a2335f5..0ff9f496ac 100644 --- a/src/internal.h +++ b/src/internal.h @@ -86,10 +86,8 @@ #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) -- GitLab