]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix processing of asterisk.conf debug=yes. 38/438/2
authorCorey Farrell <git@cfware.com>
Tue, 12 May 2015 06:31:58 +0000 (02:31 -0400)
committerCorey Farrell <git@cfware.com>
Tue, 12 May 2015 14:37:09 +0000 (09:37 -0500)
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

main/asterisk.c

index 137ee931585be1fe3adb897b9e7b7221efebaa38..a9c6d0fa8c33694c0676e230884f44fea0a9bc82 100644 (file)
@@ -3593,7 +3593,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;
                        }
 #if HAVE_WORKING_FORK
                /* Disable forking (-f at startup) */