From 2be70c3b7c3cb806614318858090c039bdfd4fc5 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sat, 7 Feb 2015 16:56:02 -0500 Subject: fix RNG with zero seed, rename VGA->GFX --- libc/stdlib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libc') diff --git a/libc/stdlib.c b/libc/stdlib.c index 49f61f1..ca890b4 100644 --- a/libc/stdlib.c +++ b/libc/stdlib.c @@ -34,5 +34,6 @@ int rand(void) void srand(unsigned int seed) { - rand_state = seed; + /* prevent a zero seed */ + rand_state = (!seed?42:seed); } -- cgit v1.1