提交 4ba52c08 authored 作者: Anthony Minessale's avatar Anthony Minessale

remove srand call to get more random strings

上级 a9c10f8c
...@@ -105,8 +105,6 @@ SWITCH_DECLARE(void) switch_stun_random_string(char *buf, uint16_t len, char *se ...@@ -105,8 +105,6 @@ SWITCH_DECLARE(void) switch_stun_random_string(char *buf, uint16_t len, char *se
max = (int) strlen(set); max = (int) strlen(set);
srand((unsigned int) switch_micro_time_now());
for (x = 0; x < len; x++) { for (x = 0; x < len; x++) {
int j = (int) (max * 1.0 * rand() / (RAND_MAX + 1.0)); int j = (int) (max * 1.0 * rand() / (RAND_MAX + 1.0));
buf[x] = set[j]; buf[x] = set[j];
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论