From 1109bc83c702a8f84e5313746b89686014b78702 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 23 Feb 2007 20:13:15 +0000 Subject: [PATCH] put blank, not printf'd null into the module load sql statements. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4376 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_core.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/switch_core.c b/src/switch_core.c index ffb6ae66f5..6df9ba621f 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -4118,13 +4118,21 @@ static void core_event_handler(switch_event_t *event) case SWITCH_EVENT_LOG: return; case SWITCH_EVENT_MODULE_LOAD: - sql = switch_mprintf("insert into interfaces (type,name,description,syntax) values('%q','%q','%q','%q')", - switch_event_get_header(event, "type"), - switch_event_get_header(event, "name"), - switch_event_get_header(event, "description"), - switch_event_get_header(event, "syntax") - ); + { + const char *type = switch_event_get_header(event, "type"); + const char *name = switch_event_get_header(event, "name"); + const char *description = switch_event_get_header(event, "description"); + const char *syntax = switch_event_get_header(event, "syntax"); + if(!switch_strlen_zero(type) && !switch_strlen_zero(name)) { + sql = switch_mprintf("insert into interfaces (type,name,description,syntax) values('%q','%q','%q','%q')", + type, + name, + switch_str_nil(description), + switch_str_nil(syntax) + ); + } break; + } default: break; }