From 070f6c95101ee6f4e7d7657124d1e0d59f219a84 Mon Sep 17 00:00:00 2001
From: Russell Bryant <russell@russellbryant.com>
Date: Mon, 21 Nov 2005 01:39:26 +0000
Subject: [PATCH] issue #5805

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 ChangeLog | 2 ++
 pbx.c     | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 17af43f99b..b94f5a1f95 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2005-11-20  Russell Bryant <russell@digium.com>
 
+	* pbx.c.c: Remove some useless checks and unnecessary calls to ast_strlen_zero(). (issue #5805)
+
 	* cli.c: Remove some unnecessary calls to ast_strlen_zero(). (issue #5804)
 
 	* channels/chan_oss.c configs/oss.conf.sample: Add the ability to set callerid in oss.conf. 
diff --git a/pbx.c b/pbx.c
index c44586caac..f16b6e2b5d 100755
--- a/pbx.c
+++ b/pbx.c
@@ -1666,14 +1666,14 @@ static int pbx_extension_helper(struct ast_channel *c, struct ast_context *con,
 				if (option_debug) {
 						ast_log(LOG_DEBUG, "Launching '%s'\n", app->name);
 						snprintf(atmp, 80, "STACK-%s-%s-%d", context, exten, priority);
-						snprintf(atmp2, EXT_DATA_SIZE+100, "%s(\"%s\", \"%s\") %s", app->name, c->name, (!ast_strlen_zero(passdata) ? (char *)passdata : ""), (newstack ? "in new stack" : "in same stack"));
+						snprintf(atmp2, EXT_DATA_SIZE+100, "%s(\"%s\", \"%s\") %s", app->name, c->name, passdata, (newstack ? "in new stack" : "in same stack"));
 						pbx_builtin_setvar_helper(c, atmp, atmp2);
 				}
 				if (option_verbose > 2)
 						ast_verbose( VERBOSE_PREFIX_3 "Executing %s(\"%s\", \"%s\") %s\n", 
 								term_color(tmp, app->name, COLOR_BRCYAN, 0, sizeof(tmp)),
 								term_color(tmp2, c->name, COLOR_BRMAGENTA, 0, sizeof(tmp2)),
-								term_color(tmp3, (!ast_strlen_zero(passdata) ? (char *)passdata : ""), COLOR_BRMAGENTA, 0, sizeof(tmp3)),
+								term_color(tmp3, passdata, COLOR_BRMAGENTA, 0, sizeof(tmp3)),
 								(newstack ? "in new stack" : "in same stack"));
 				manager_event(EVENT_FLAG_CALL, "Newexten", 
 					"Channel: %s\r\n"
@@ -1683,7 +1683,7 @@ static int pbx_extension_helper(struct ast_channel *c, struct ast_context *con,
 					"Application: %s\r\n"
 					"AppData: %s\r\n"
 					"Uniqueid: %s\r\n",
-					c->name, c->context, c->exten, c->priority, app->name, passdata ? passdata : "(NULL)", c->uniqueid);
+					c->name, c->context, c->exten, c->priority, app->name, passdata, c->uniqueid);
 				res = pbx_exec(c, app, passdata, newstack);
 				return res;
 			} else {
@@ -2473,7 +2473,7 @@ static int increase_call_count(const struct ast_channel *c)
 	if (option_maxload) {
 		getloadavg(&curloadavg, 1);
 		if (curloadavg >= option_maxload) {
-			ast_log(LOG_NOTICE, "Maximum loadavg limit of %lf load exceeded by '%s' (currently %f)!\n", option_maxload, c->name, curloadavg);
+			ast_log(LOG_NOTICE, "Maximum loadavg limit of %f load exceeded by '%s' (currently %f)!\n", option_maxload, c->name, curloadavg);
 			failed = -1;
 		}
 	}
-- 
GitLab