[Freeswitch-svn] [commit] r4376 - freeswitch/trunk/src

Freeswitch SVN mikej at freeswitch.org
Fri Feb 23 15:13:15 EST 2007


Author: mikej
Date: Fri Feb 23 15:13:15 2007
New Revision: 4376

Modified:
   freeswitch/trunk/src/switch_core.c

Log:
put blank, not printf'd null into the module load sql statements.

Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c	(original)
+++ freeswitch/trunk/src/switch_core.c	Fri Feb 23 15:13:15 2007
@@ -4118,13 +4118,21 @@
 	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;
 	}



More information about the Freeswitch-svn mailing list