From 91b321ff3cb15ca37b5530c9ec5c0f4007b54988 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Mon, 30 Mar 2015 22:53:45 +0200 Subject: [PATCH] By Harry Coin: make IsEmptyStr NULL-pointer-safe. --- libcitadel/lib/libcitadel.h | 2 +- webcit/webcit.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/libcitadel/lib/libcitadel.h b/libcitadel/lib/libcitadel.h index 3e48a35f3..d7da488f1 100644 --- a/libcitadel/lib/libcitadel.h +++ b/libcitadel/lib/libcitadel.h @@ -108,7 +108,7 @@ typedef enum _room_views { #define BLOG_EUIDBUF_SIZE 40 #ifndef IsEmptyStr -#define IsEmptyStr(a) ((a)[0] == '\0') +#define IsEmptyStr(a) ( ( (a) == NULL ) || ((a)[0] == '\0') ) #endif diff --git a/webcit/webcit.h b/webcit/webcit.h index 64034c777..c5e1fe422 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -61,8 +61,6 @@ #define _(string) (string) #endif -#define IsEmptyStr(a) ((a)[0] == '\0') - #define DO_DBG_QR 0 #define DBG_QR(x) if(DO_DBG_QR) _DBG_QR(x) #define DBG_QR2(x) if(DO_DBG_QR) _DBG_QR2(x) -- 2.30.2