aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleovilok <leovilok@gmail.com>2017-04-21 14:49:16 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-04-22 13:55:32 +0200
commit1f097f28e08aabcb382283e429494a25c552d87d (patch)
tree2680e4ff99b0c1397d770bc8c879a19443dab1bb
parent9bec745dde6a85b16d2bb87a4ab1c86961e5d950 (diff)
downloadmblaze-1f097f28e08aabcb382283e429494a25c552d87d.tar.gz
mgenmid: fix fallback random generation on 32bit
lrand48 returns a long int, which is 32bits wide on 32bits systems Closes: #28 [via git-merge-pr]
-rw-r--r--mgenmid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mgenmid.c b/mgenmid.c
index 6e5ec9d..36aa8c8 100644
--- a/mgenmid.c
+++ b/mgenmid.c
@@ -99,7 +99,7 @@ int main()
} else {
fallback:
srand48(tp.tv_sec ^ tp.tv_usec ^ getpid());
- rnd = (lrand48() << 32) + lrand48();
+ rnd = ((uint64_t)lrand48() << 32) + lrand48();
}
rnd |= (1LL << 63); // set highest bit to force full width