mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
internal: Use g_strcmp0 in STR(N)EQ_NULLABLE
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
634dbd936b
commit
27bab9cac4
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user