Truncate rand16() result to 16 bits

This commit is contained in:
Christopher Wellons 2019-02-05 23:25:48 -05:00
parent 1583f6e5b3
commit 47b901d9d3

View File

@ -237,7 +237,7 @@ static unsigned
rand16(unsigned long s[1])
{
s[0] = s[0] * 1103515245UL + 12345UL;
return s[0] >> 16;
return (s[0] >> 16) & 0xffff;
}
static int