aboutsummaryrefslogtreecommitdiff
path: root/libc/stdlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib.c')
-rw-r--r--libc/stdlib.c3
1 files changed, 2 insertions, 1 deletions
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);
}