Fix processing of asterisk.conf debug=yes.

The code which reads asterisk.conf supports processing the debug
option with ast_true, but ast_true returns -1.  This causes debug
to still be off, convert to 1 so debug will be on as requested.

ASTERISK-25042
Reported by: Corey Farrell

Change-Id: I3c898b7d082d914b057e111b9357fde46bad9ed6
This commit is contained in:
Corey Farrell 2015-05-12 02:31:58 -04:00
parent 58d0db347e
commit cc853dcf90
1 changed files with 1 additions and 1 deletions

View File

@ -3498,7 +3498,7 @@ static void ast_readconfig(void)
} else if (!strcasecmp(v->name, "debug")) {
option_debug = 0;
if (sscanf(v->value, "%30d", &option_debug) != 1) {
option_debug = ast_true(v->value);
option_debug = ast_true(v->value) ? 1 : 0;
}
} else if (!strcasecmp(v->name, "refdebug")) {
ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_REF_DEBUG);