[asterisk-commits] rmudgett: branch rmudgett/ast_verb r405293 - /team/rmudgett/ast_verb/main/cli.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 10 13:14:52 CST 2014


Author: rmudgett
Date: Fri Jan 10 13:14:50 2014
New Revision: 405293

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=405293
Log:
Be consistent in status_debug_verbose().

Modified:
    team/rmudgett/ast_verb/main/cli.c

Modified: team/rmudgett/ast_verb/main/cli.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ast_verb/main/cli.c?view=diff&rev=405293&r1=405292&r2=405293
==============================================================================
--- team/rmudgett/ast_verb/main/cli.c (original)
+++ team/rmudgett/ast_verb/main/cli.c Fri Jan 10 13:14:50 2014
@@ -379,24 +379,22 @@
 
 static void status_debug_verbose(struct ast_cli_args *a, const char *what, int old_val, int cur_val)
 {
+	char was_buf[30];
+	const char *was;
+
+	if (old_val) {
+		snprintf(was_buf, sizeof(was_buf), "%d", old_val);
+		was = was_buf;
+	} else {
+		was = "OFF";
+	}
+
 	if (old_val == cur_val) {
-		if (old_val) {
-			ast_cli(a->fd, "%s is still %d.\n", what, old_val);
-		} else {
-			ast_cli(a->fd, "%s is still OFF.\n", what);
-		}
+		ast_cli(a->fd, "%s is still %s.\n", what, was);
 	} else {
-		char was_buf[30];
 		char now_buf[30];
-		const char *was;
 		const char *now;
 
-		if (old_val) {
-			snprintf(was_buf, sizeof(was_buf), "%d", old_val);
-			was = was_buf;
-		} else {
-			was = "OFF";
-		}
 		if (cur_val) {
 			snprintf(now_buf, sizeof(now_buf), "%d", cur_val);
 			now = now_buf;




More information about the asterisk-commits mailing list