From: Wilfried Goesgens Date: Mon, 30 Mar 2015 20:53:45 +0000 (+0200) Subject: By Harry Coin: make IsEmptyStr NULL-pointer-safe. X-Git-Tag: v9.01~5 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=91b321ff3cb15ca37b5530c9ec5c0f4007b54988 By Harry Coin: make IsEmptyStr NULL-pointer-safe. --- 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)