diff options
author | Joshua Colp <jcolp@digium.com> | 2015-11-21 11:36:42 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2015-11-21 11:36:43 -0600 |
commit | 04874067818584b5824acc24ed2835bb158f3ce2 (patch) | |
tree | f51431cd1bff09a38934ec67ed29bc289f7998f8 | |
parent | 4036019b76589c05b262e3819c0299e56712b628 (diff) | |
parent | 9315a93757e2f78d5d54e9363a45bc8e1cba7f33 (diff) |
Merge "main/cli: Use proper string methods to check existence of context/exten/app"
-rw-r--r-- | main/cli.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/main/cli.c b/main/cli.c index b3d4cac3d..917305594 100644 --- a/main/cli.c +++ b/main/cli.c @@ -1076,10 +1076,12 @@ static char *handle_chanlist(struct ast_cli_entry *e, int cmd, struct ast_cli_ar char locbuf[40] = "(None)"; char appdata[40] = "(None)"; - if (!cs->context && !cs->exten) + if (!ast_strlen_zero(cs->context) && !ast_strlen_zero(cs->exten)) { snprintf(locbuf, sizeof(locbuf), "%s@%s:%d", cs->exten, cs->context, cs->priority); - if (cs->appl) + } + if (!ast_strlen_zero(cs->appl)) { snprintf(appdata, sizeof(appdata), "%s(%s)", cs->appl, S_OR(cs->data, "")); + } ast_cli(a->fd, FORMAT_STRING, cs->name, locbuf, ast_state2str(cs->state), appdata); } } |