summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/seed48.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/seed48.c')
-rw-r--r--lib/libc/stdlib/seed48.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/libc/stdlib/seed48.c b/lib/libc/stdlib/seed48.c
index 583262f2d53..7acb4e6d1de 100644
--- a/lib/libc/stdlib/seed48.c
+++ b/lib/libc/stdlib/seed48.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: seed48.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: seed48.c,v 1.4 2014/12/08 21:45:20 deraadt Exp $ */
/*
* Copyright (c) 1993 Martin Birgmeier
* All rights reserved.
@@ -21,8 +21,19 @@ extern unsigned short __rand48_add;
unsigned short *
seed48(unsigned short xseed[3])
{
+ unsigned short *res;
+
+ res = seed48_deterministic(xseed);
+ __rand48_deterministic = 0;
+ return res;
+}
+
+unsigned short *
+seed48_deterministic(unsigned short xseed[3])
+{
static unsigned short sseed[3];
+ __rand48_deterministic = 1;
sseed[0] = __rand48_seed[0];
sseed[1] = __rand48_seed[1];
sseed[2] = __rand48_seed[2];