From ecc37e4b2a1cca6f3dbd451a22c53b73c344bebd Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 25 Jan 2013 11:55:03 -0500 Subject: [PATCH] fix segfault related to null log_info --- daemon/call.c | 2 +- daemon/str.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/daemon/call.c b/daemon/call.c index 09de8665d..844077aae 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -37,7 +37,7 @@ #define LOG_PREFIX_C "[%.*s] " #define LOG_PREFIX_CI "[%.*s - %.*s] " #define LOG_PARAMS_C(c) STR_FMT(&(c)->callid) -#define LOG_PARAMS_CI(c) STR_FMT(&(c)->callid), STR_FMT(log_info) +#define LOG_PARAMS_CI(c) STR_FMT(&(c)->callid), STR_FMT0(log_info) static __thread const str *log_info; diff --git a/daemon/str.h b/daemon/str.h index 2e40bcfb4..c3cee3932 100644 --- a/daemon/str.h +++ b/daemon/str.h @@ -21,6 +21,7 @@ typedef struct _str str; #define STR_FORMAT "%.*s" #define STR_FMT(str) (str)->len, (str)->s +#define STR_FMT0(str) ((str) ? (str)->len : 6), ((str) ? (str)->s : "(NULL)") #define STR_NULL (str) { NULL, 0 } #define STR_EMPTY (str) { "", 0 }