diff options
author | Jason Parker <jparker@digium.com> | 2008-05-06 19:38:44 +0000 |
---|---|---|
committer | Jason Parker <jparker@digium.com> | 2008-05-06 19:38:44 +0000 |
commit | d63b790247e6f4ea7bfe6b311801215c286de935 (patch) | |
tree | e521b6ddb4d7456c3b8ceda81c6c4470f385b469 /res/res_musiconhold.c | |
parent | ff01792e500be68a65bde73e29aa3ba4f79ede9c (diff) |
Merged revisions 115418 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r115418 | qwell | 2008-05-06 14:34:58 -0500 (Tue, 06 May 2008) | 7 lines
Switch to using ast_random() rather than just rand().
This does not fix the bug reported, but I believe it is correct.
(from issue #12446)
Patches:
bug_12446.diff uploaded by snuffy (license 35)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115419 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_musiconhold.c')
-rw-r--r-- | res/res_musiconhold.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index c78c62950..d64e55cce 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -256,7 +256,7 @@ static int ast_moh_files_next(struct ast_channel *chan) } else if (ast_test_flag(state->class, MOH_RANDOMIZE)) { /* Get a random file and ensure we can open it */ for (tries = 0; tries < 20; tries++) { - state->pos = rand() % state->class->total_files; + state->pos = ast_random() % state->class->total_files; if (ast_fileexists(state->class->filearray[state->pos], NULL, NULL) > 0) break; } |