diff options
author | Kinsey Moore <kmoore@digium.com> | 2012-05-10 20:56:09 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2012-05-10 20:56:09 +0000 |
commit | dd81b047dbf15a501b81354db505daf50703a1a0 (patch) | |
tree | 01754d4206c865653717baf23e47ed264f7a6b3d /apps/app_voicemail.c | |
parent | 8227f70cd70f497cb03c1f9aab63950bcd979d8b (diff) |
Resolve FORWARD_NULL static analysis warnings
This resolves core findings from ASTERISK-19650 numbers 0-2, 6, 7, 9-11, 14-20,
22-24, 28, 30-32, 34-36, 42-56, 82-84, 87, 89-90, 93-102, 104, 105, 109-111,
and 115. Finding numbers 26, 33, and 29 were already resolved. Those skipped
were either extended/deprecated or in areas of code that shouldn't be
disturbed.
(Closes issue ASTERISK-19650)
........
Merged revisions 366167 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 366168 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r-- | apps/app_voicemail.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index d4da42b03..7e75ea9a9 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -11371,13 +11371,15 @@ static char *handle_voicemail_show_users(struct ast_cli_entry *e, int cmd, struc AST_LIST_UNLOCK(&users); return CLI_FAILURE; } - if (a->argc == 3) + if (!context) { ast_cli(a->fd, HVSU_OUTPUT_FORMAT, "Context", "Mbox", "User", "Zone", "NewMsg"); - else { + } else { int count = 0; AST_LIST_TRAVERSE(&users, vmu, list) { - if (!strcmp(context, vmu->context)) + if (!strcmp(context, vmu->context)) { count++; + break; + } } if (count) { ast_cli(a->fd, HVSU_OUTPUT_FORMAT, "Context", "Mbox", "User", "Zone", "NewMsg"); @@ -11391,7 +11393,7 @@ static char *handle_voicemail_show_users(struct ast_cli_entry *e, int cmd, struc int newmsgs = 0, oldmsgs = 0; char count[12], tmp[256] = ""; - if ((a->argc == 3) || ((a->argc == 5) && !strcmp(context, vmu->context))) { + if (!context || !strcmp(context, vmu->context)) { snprintf(tmp, sizeof(tmp), "%s@%s", vmu->mailbox, ast_strlen_zero(vmu->context) ? "default" : vmu->context); inboxcount(tmp, &newmsgs, &oldmsgs); snprintf(count, sizeof(count), "%d", newmsgs); |