aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js
index 632df975..d9e1942f 100644
--- a/src/library.js
+++ b/src/library.js
@@ -3458,7 +3458,7 @@ LibraryManager.library = {
rand_r: function(seedp) {
seedp = seedp|0;
var val = 0;
- val = (Math_imul({{{ makeGetValueAsm('seedp', 0, 'i32') }}}, 31010991)|0) + 0x676e6177 | 0;
+ val = ((Math_imul({{{ makeGetValueAsm('seedp', 0, 'i32') }}}, 31010991)|0) + 0x676e6177 ) & {{{ cDefine('RAND_MAX') }}};
{{{ makeSetValueAsm('seedp', 0, 'val', 'i32') }}};
return val|0;
},