[asterisk-commits] mnick: trunk r221436 - /trunk/apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 30 16:15:04 CDT 2009


Author: mnick
Date: Wed Sep 30 16:15:01 2009
New Revision: 221436

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=221436
Log:
Prevents from division by zero

Modified:
    trunk/apps/app_queue.c

Modified: trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_queue.c?view=diff&rev=221436&r1=221435&r2=221436
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Wed Sep 30 16:15:01 2009
@@ -2911,7 +2911,7 @@
 
 	ast_verb(3, "Playing periodic announcement\n");
 	
-	if (qe->parent->randomperiodicannounce) {
+	if (qe->parent->randomperiodicannounce && qe->parent->numperiodicannounce) {
 		qe->last_periodic_announce_sound = ((unsigned long) ast_random()) % qe->parent->numperiodicannounce;
 	} else if (qe->last_periodic_announce_sound >= qe->parent->numperiodicannounce || 
 		ast_str_strlen(qe->parent->sound_periodicannounce[qe->last_periodic_announce_sound]) == 0) {




More information about the asterisk-commits mailing list