diff options
Diffstat (limited to 'libc/stdlib.c')
| -rw-r--r-- | libc/stdlib.c | 3 |
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); } |