]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
put blank, not printf'd null into the module load sql statements.
authorMichael Jerris <mike@jerris.com>
Fri, 23 Feb 2007 20:13:15 +0000 (20:13 +0000)
committerMichael Jerris <mike@jerris.com>
Fri, 23 Feb 2007 20:13:15 +0000 (20:13 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4376 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_core.c

index ffb6ae66f5255ade177a97b8fb1c91aacc4f11c1..6df9ba621f1a390505fea50af6c36d719062368e 100644 (file)
@@ -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;
        }