[asterisk-commits] jpeeler: trunk r121131 - /trunk/apps/app_parkandannounce.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jun 7 20:16:26 CDT 2008


Author: jpeeler
Date: Sat Jun  7 20:16:25 2008
New Revision: 121131

URL: http://svn.digium.com/view/asterisk?view=rev&rev=121131
Log:
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.

Modified:
    trunk/apps/app_parkandannounce.c

Modified: trunk/apps/app_parkandannounce.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_parkandannounce.c?view=diff&rev=121131&r1=121130&r2=121131
==============================================================================
--- trunk/apps/app_parkandannounce.c (original)
+++ trunk/apps/app_parkandannounce.c Sat Jun  7 20:16:25 2008
@@ -144,9 +144,12 @@
 
 	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]);




More information about the asterisk-commits mailing list