aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/res_musiconhold.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 0406a1796..faab84cae 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -247,7 +247,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;
}