From: Luigi Rizzo Date: Tue, 9 May 2006 06:14:30 +0000 (+0000) Subject: use S_OR where appropriate, comment an unclear difference in format X-Git-Tag: 1.4.0-beta1~1485 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fd45a19ab42c37b3470f768f70aeef6378d12d79;p=thirdparty%2Fasterisk.git use S_OR where appropriate, comment an unclear difference in format between CONCISE and VERBOSE git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@25860 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/cli.c b/cli.c index 09803954f5..0c5e840884 100644 --- a/cli.c +++ b/cli.c @@ -422,15 +422,21 @@ static int handle_chanlist(int fd, int argc, char *argv[]) } if (concise) { ast_cli(fd, CONCISE_FORMAT_STRING, c->name, c->context, c->exten, c->priority, ast_state2str(c->_state), - c->appl ? c->appl : "(None)", c->data ? c->data : "", + c->appl ? c->appl : "(None)", + S_OR(c->data, ""), /* XXX different from verbose ? */ S_OR(c->cid.cid_num, ""), - c->accountcode ? c->accountcode : "", c->amaflags, - durbuf, bc ? bc->name : "(None)"); + S_OR(c->accountcode, ""), + c->amaflags, + durbuf, + bc ? bc->name : "(None)"); } else if (verbose) { ast_cli(fd, VERBOSE_FORMAT_STRING, c->name, c->context, c->exten, c->priority, ast_state2str(c->_state), - c->appl ? c->appl : "(None)", c->data ? S_OR(c->data, "(Empty)" ): "(None)", - S_OR(c->cid.cid_num, ""), durbuf, - c->accountcode ? c->accountcode : "", bc ? bc->name : "(None)"); + c->appl ? c->appl : "(None)", + c->data ? S_OR(c->data, "(Empty)" ): "(None)", + S_OR(c->cid.cid_num, ""), + durbuf, + S_OR(c->accountcode, ""), + bc ? bc->name : "(None)"); } else { if (!ast_strlen_zero(c->context) && !ast_strlen_zero(c->exten)) snprintf(locbuf, sizeof(locbuf), "%s@%s:%d", c->exten, c->context, c->priority);