fix build.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6897 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2007-12-19 05:41:14 +00:00
parent 285e8fc3c4
commit 8a9ac53124
1 changed files with 4 additions and 2 deletions

View File

@ -77,9 +77,11 @@ static unsigned int S = 0;
static int do_rand(void)
{
double r;
int index;
srand(getpid() + ++S);
double r = ((double)rand() / ((double)(RAND_MAX)+(double)(1)));
int index = (r * 9) + 1;
r = ((double)rand() / ((double)(RAND_MAX)+(double)(1)));
index = (int)(r * 9) + 1;
return index;
}