diff --git a/apps/app_minivm.c b/apps/app_minivm.c index c4bbce43d2..3e50580671 100644 --- a/apps/app_minivm.c +++ b/apps/app_minivm.c @@ -1177,7 +1177,7 @@ static int sendmail(struct minivm_template *template, struct minivm_account *vmu } ast_debug(4, "Fromstring now: %s\n", ast_strlen_zero(passdata) ? "-default-" : passdata); - fprintf(p, "Message-ID: \n", (unsigned int)rand(), vmu->username, (int)getpid(), who); + fprintf(p, "Message-ID: \n", (unsigned int)ast_random(), vmu->username, (int)getpid(), who); len_passdata = strlen(vmu->fullname) * 2 + 3; passdata2 = alloca(len_passdata); if (!ast_strlen_zero(vmu->email)) @@ -1210,7 +1210,7 @@ static int sendmail(struct minivm_template *template, struct minivm_account *vmu fprintf(p, "MIME-Version: 1.0\n"); /* Something unique. */ - snprintf(bound, sizeof(bound), "voicemail_%s%d%d", vmu->username, (int)getpid(), (unsigned int)rand()); + snprintf(bound, sizeof(bound), "voicemail_%s%d%d", vmu->username, (int)getpid(), (unsigned int)ast_random()); fprintf(p, "Content-Type: multipart/mixed; boundary=\"%s\"\n\n\n", bound); diff --git a/main/manager.c b/main/manager.c index 77362cb879..b5cc844bdd 100644 --- a/main/manager.c +++ b/main/manager.c @@ -3803,7 +3803,7 @@ static struct ast_str *generic_http_callback(enum output_format format, * properties of the rand() function (and the constantcy of s), that * won't happen twice in a row. */ - while ((session->managerid = rand() ^ (unsigned long) session) == 0); + while ((session->managerid = ast_random() ^ (unsigned long) session) == 0); session->last_ev = grab_last(); AST_LIST_HEAD_INIT_NOLOCK(&session->datastores); AST_LIST_LOCK(&sessions);