FS-8811 fix divide by 0

This commit is contained in:
Seven Du 2016-03-05 20:32:40 +08:00
parent b80eb983ec
commit f0c76fab80
1 changed files with 2 additions and 0 deletions

View File

@ -183,6 +183,8 @@ static int do_rand(uint32_t count)
{
int r = 0;
if (count == 0) return 0;
switch_mutex_lock(globals.mutex);
r = (rand() % count) + 1;
switch_mutex_unlock(globals.mutex);