aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-08 01:16:25 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-08 01:16:25 +0000
commit592ef84d247f6aef8fd481094664b0c24ed2946d (patch)
treed26456d4a4fdf4d07a7cf1b5dd08467b69c2f854 /apps
parentf14225c2fc4ba8f99c059f2ec93820f37c6eab96 (diff)
Fixes segfault when using ParkAndAnnounce. Also, loop made more efficient as announce template only needs to be checked until the number of colon separated arguments run out, not the entire pointer storage array. Was done in a similiar fashion in 1.4, but here we're using less variables.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@121131 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_parkandannounce.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/app_parkandannounce.c b/apps/app_parkandannounce.c
index d1066fd2c..45740d901 100644
--- a/apps/app_parkandannounce.c
+++ b/apps/app_parkandannounce.c
@@ -144,9 +144,12 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data)
ast_verb(4, "Announce Template:%s\n", args.template);
- for (looptemp = 0, tmp[looptemp++] = strsep(&args.template, ":");
- looptemp < sizeof(tmp) / sizeof(tmp[0]);
- tmp[looptemp++] = strsep(&args.template, ":"));
+ for (looptemp = 0; looptemp < sizeof(tmp) / sizeof(tmp[0]); looptemp++) {
+ if ((tmp[looptemp] = strsep(&args.template, ":")) != NULL)
+ continue;
+ else
+ break;
+ }
for (i = 0; i < looptemp; i++) {
ast_verb(4, "Announce:%s\n", tmp[i]);