Skip to content
Snippets Groups Projects
Commit 5ed63ffc authored by Mark Spencer's avatar Mark Spencer
Browse files

Add CDR custom config warnings (Borga borga!) :)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 7d2b5941
Branches
Tags
No related merge requests found
......@@ -61,6 +61,8 @@ static int load_config(int reload)
while(var) {
ast_mutex_lock(&lock);
if (!ast_strlen_zero(var->name) && !ast_strlen_zero(var->value)) {
if (strlen(var->value) > (sizeof(format) - 2))
ast_log(LOG_WARNING, "Format string too long, will be truncated, at line %d\n", var->lineno);
strncpy(format, var->value, sizeof(format) - 2);
strcat(format,"\n");
snprintf(master, sizeof(master),"%s/%s/%s", ast_config_AST_LOG_DIR, name, var->name);
......@@ -72,6 +74,11 @@ static int load_config(int reload)
var = var->next;
}
ast_config_destroy(cfg);
} else {
if (reload)
ast_log(LOG_WARNING, "Failed to reload configuration file.\n");
else
ast_log(LOG_WARNING, "Failed to load configuration file. Module not activated.\n");
}
return res;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment