Fixing random() to work with longs.

This commit is contained in:
David A. Mellis 2008-05-26 14:02:32 +00:00
parent 03d7c9b846
commit 75d1f5053c
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ long random(long howbig)
if (howbig == 0){
return 0;
}
return rand() % howbig;
return (rand() * 0x10000L + rand()) % howbig;
}
long random(long howsmall, long howbig)