mirror of
https://github.com/skeeto/endlessh.git
synced 2025-12-08 22:23:23 +00:00
Truncate rand16() result to 16 bits
This commit is contained in:
@@ -237,7 +237,7 @@ static unsigned
|
|||||||
rand16(unsigned long s[1])
|
rand16(unsigned long s[1])
|
||||||
{
|
{
|
||||||
s[0] = s[0] * 1103515245UL + 12345UL;
|
s[0] = s[0] * 1103515245UL + 12345UL;
|
||||||
return s[0] >> 16;
|
return (s[0] >> 16) & 0xffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|||||||
Reference in New Issue
Block a user