diff options
author | Walter Doekes <walter+asterisk@wjd.nu> | 2012-02-08 20:49:48 +0000 |
---|---|---|
committer | Walter Doekes <walter+asterisk@wjd.nu> | 2012-02-08 20:49:48 +0000 |
commit | db24fc2523da16bd812abb2a35b6320d24083e3f (patch) | |
tree | 4f4d564d4c32538014aefd01789f3f2bffc5520e /apps/app_chanspy.c | |
parent | 0adeb88318467f75f84a70990b1f982b9ca470f3 (diff) |
Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: Clod Patry
Review: https://reviewboard.asterisk.org/r/1651
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_chanspy.c')
-rw-r--r-- | apps/app_chanspy.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index 4c709cfcc..ab7887764 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -614,7 +614,7 @@ static int channel_spy(struct ast_channel *chan, struct ast_autochan *spyee_auto has arrived, since the spied-on channel could have gone away while we were waiting */ - while ((res = ast_waitfor(chan, -1) > -1) && csth.spy_audiohook.status == AST_AUDIOHOOK_STATUS_RUNNING) { + while (ast_waitfor(chan, -1) > -1 && csth.spy_audiohook.status == AST_AUDIOHOOK_STATUS_RUNNING) { if (!(f = ast_read(chan)) || ast_check_hangup(chan)) { running = -1; break; @@ -771,7 +771,6 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags, int waitms; int res; char *ptr; - int num; int num_spyed_upon = 1; struct ast_channel_iterator *iter = NULL; @@ -962,6 +961,7 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags, res = ast_app_sayname(chan, local_mailbox, local_context); } if (!ast_test_flag(flags, OPTION_NAME) || res < 0) { + int num; if (!ast_test_flag(flags, OPTION_NOTECH)) { if (ast_fileexists(peer_name, NULL, NULL) > 0) { res = ast_streamfile(chan, peer_name, ast_channel_language(chan)); @@ -976,8 +976,9 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags, res = ast_say_character_str(chan, peer_name, "", ast_channel_language(chan)); } } - if ((num = atoi(ptr))) - ast_say_digits(chan, atoi(ptr), "", ast_channel_language(chan)); + if ((num = atoi(ptr))) { + ast_say_digits(chan, num, "", ast_channel_language(chan)); + } } } |