]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
always init the levels array.
authorMichael Jerris <mike@jerris.com>
Wed, 5 Dec 2007 13:25:33 +0000 (13:25 +0000)
committerMichael Jerris <mike@jerris.com>
Wed, 5 Dec 2007 13:25:33 +0000 (13:25 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6518 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/loggers/mod_logfile/mod_logfile.c

index 924ac20d65256d8df3ab3e301fb72de8baafafd1..aafe5eca47b4a06ccbbead1fc54c8583c8f563da 100644 (file)
@@ -94,15 +94,6 @@ void process_levels(logfile_profile_t *profile, char *p)
        int x, i, argc = 0;
        char *argv[10] = { 0 };
 
-       profile->levels[0].level = SWITCH_LOG_CONSOLE;
-       profile->levels[1].level = SWITCH_LOG_ALERT;
-       profile->levels[2].level = SWITCH_LOG_CRIT;
-       profile->levels[3].level = SWITCH_LOG_ERROR;
-       profile->levels[4].level = SWITCH_LOG_WARNING;
-       profile->levels[5].level = SWITCH_LOG_NOTICE;
-       profile->levels[6].level = SWITCH_LOG_INFO;
-       profile->levels[7].level = SWITCH_LOG_DEBUG;
-
        for (i=0; i < (sizeof(profile->levels) / sizeof(struct level_set)); i++) {
                profile->levels[i].on = 0;
        }
@@ -269,6 +260,15 @@ static switch_status_t load_profile(logfile_profile_t *profile, switch_xml_t xml
 {
        switch_xml_t param;
 
+       profile->levels[0].level = SWITCH_LOG_CONSOLE;
+       profile->levels[1].level = SWITCH_LOG_ALERT;
+       profile->levels[2].level = SWITCH_LOG_CRIT;
+       profile->levels[3].level = SWITCH_LOG_ERROR;
+       profile->levels[4].level = SWITCH_LOG_WARNING;
+       profile->levels[5].level = SWITCH_LOG_NOTICE;
+       profile->levels[6].level = SWITCH_LOG_INFO;
+       profile->levels[7].level = SWITCH_LOG_DEBUG;
+
        for (param = switch_xml_child(xml, "param"); param; param = param->next) {
                char *var = (char *) switch_xml_attr_soft(param, "name");
                char *val = (char *) switch_xml_attr_soft(param, "value");