rand() did not work on 2-byte machines
authorceriel <none@none>
Sat, 30 Jun 1990 20:02:45 +0000 (20:02 +0000)
committerceriel <none@none>
Sat, 30 Jun 1990 20:02:45 +0000 (20:02 +0000)
lang/cem/libcc.ansi/stdlib/rand.c

index dbae2b1..82afb2e 100644 (file)
@@ -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)