always init the levels array.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6518 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2007-12-05 13:25:33 +00:00
parent 676c6f5635
commit b010bb1f07

View File

@ -94,15 +94,6 @@ void process_levels(logfile_profile_t *profile, char *p)
int x, i, argc = 0; int x, i, argc = 0;
char *argv[10] = { 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++) { for (i=0; i < (sizeof(profile->levels) / sizeof(struct level_set)); i++) {
profile->levels[i].on = 0; 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; 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) { for (param = switch_xml_child(xml, "param"); param; param = param->next) {
char *var = (char *) switch_xml_attr_soft(param, "name"); char *var = (char *) switch_xml_attr_soft(param, "name");
char *val = (char *) switch_xml_attr_soft(param, "value"); char *val = (char *) switch_xml_attr_soft(param, "value");