diff --git a/main/asterisk.c b/main/asterisk.c
index 137ee931585be1fe3adb897b9e7b7221efebaa38..a9c6d0fa8c33694c0676e230884f44fea0a9bc82 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -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) */