]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9978: [mod_expr] mod_expr random seed function not working for Windows #resolve
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 25 Jan 2017 18:48:01 +0000 (12:48 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 25 Jan 2017 18:48:07 +0000 (12:48 -0600)
src/mod/applications/mod_expr/exprilfs.h

index 7efc281c16ccb418b9adfac84c484d1a4672b176..05abb5f12ba2725cea7bf107467d20a15a5029fc 100644 (file)
@@ -496,9 +496,10 @@ case EXPR_NODEFUNC_RANDOMIZE:
 {
        static int curcall = 0;
 
-       curcall++;
+       curcall += clock() + time(NULL);
+       curcall = curcall * 31821U + 13849U;
 
-       *(nodes->data.function.refs[0]) = (EXPRTYPE) ((clock() + 1024 + curcall) * time(NULL));
+       *(nodes->data.function.refs[0]) = (EXPRTYPE) curcall;
 
        break;
 }