summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2013-07-03 23:27:04 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2013-07-03 23:27:04 +0000
commitdf5c65e22a92650e4cb34f8c9ea8d0c89a80c861 (patch)
treefdd0c9e177d7bd5e15c9612d1cb489593d54b6ae
parentbe28275d008e76ef46d262a824cb390f31cf3d4f (diff)
Notes
-rw-r--r--lib/libc/stdlib/rand.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c
index 676c95e972ff..58b37539c3a6 100644
--- a/lib/libc/stdlib/rand.c
+++ b/lib/libc/stdlib/rand.c
@@ -90,7 +90,11 @@ rand_r(unsigned int *ctx)
#endif
int r = do_rand(&val);
- *ctx = (unsigned int) val;
+#ifdef USE_WEAK_SEEDING
+ *ctx = (unsigned int)val;
+#else
+ *ctx = (unsigned int)(val - 1);
+#endif
return (r);
}