summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortedu <>2014-12-09 00:02:18 +0000
committertedu <>2014-12-09 00:02:18 +0000
commit0b444f25e9fd0e5ce3b3a121dd879cb28220c954 (patch)
tree1f7843133ea04160e28399e9ba01ce35d608c449
parent31bddc87ad05f16cc01a1cc28fd0a68ad1254d00 (diff)
downloadopenbsd-0b444f25e9fd0e5ce3b3a121dd879cb28220c954.tar.gz
openbsd-0b444f25e9fd0e5ce3b3a121dd879cb28220c954.tar.bz2
openbsd-0b444f25e9fd0e5ce3b3a121dd879cb28220c954.zip
more standardsier: cast to int to make sure we keep the negative numbers.
observed by jonas termansen
-rw-r--r--src/lib/libc/stdlib/mrand48.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/mrand48.c b/src/lib/libc/stdlib/mrand48.c
index 7bfccbbf83..0568a7ff93 100644
--- a/src/lib/libc/stdlib/mrand48.c
+++ b/src/lib/libc/stdlib/mrand48.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: mrand48.c,v 1.4 2014/12/08 21:45:20 deraadt Exp $ */ 1/* $OpenBSD: mrand48.c,v 1.5 2014/12/09 00:02:18 tedu Exp $ */
2/* 2/*
3 * Copyright (c) 1993 Martin Birgmeier 3 * Copyright (c) 1993 Martin Birgmeier
4 * All rights reserved. 4 * All rights reserved.
@@ -20,7 +20,7 @@ long
20mrand48(void) 20mrand48(void)
21{ 21{
22 if (__rand48_deterministic == 0) 22 if (__rand48_deterministic == 0)
23 return arc4random(); 23 return (int)arc4random();
24 __dorand48(__rand48_seed); 24 __dorand48(__rand48_seed);
25 return ((long) __rand48_seed[2] << 16) + (long) __rand48_seed[1]; 25 return ((long) __rand48_seed[2] << 16) + (long) __rand48_seed[1];
26} 26}