From c6a11d1f620ba8ceb675db645d5b3435aaa95f26 Mon Sep 17 00:00:00 2001 From: ceriel Date: Sat, 30 Jun 1990 20:02:45 +0000 Subject: [PATCH] rand() did not work on 2-byte machines --- lang/cem/libcc.ansi/stdlib/rand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cem/libcc.ansi/stdlib/rand.c b/lang/cem/libcc.ansi/stdlib/rand.c index dbae2b10e..82afb2e86 100644 --- a/lang/cem/libcc.ansi/stdlib/rand.c +++ b/lang/cem/libcc.ansi/stdlib/rand.c @@ -11,7 +11,7 @@ static unsigned long int next = 1; int rand(void) { next = next * 1103515245 + 12345; - return (unsigned int)(next/(2 * (RAND_MAX +1)) % (RAND_MAX+1)); + return (unsigned int)(next/(2 * (RAND_MAX +1L)) % (RAND_MAX+1L)); } void srand(unsigned int seed) -- 2.34.1