mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
ndis(4): adjustments for our random() specific implementation.
- Revert r300377: The implementation claims to return a value within the range. [1] - Adjust the value for the case of a zero seed, whihc according to standards should be equivalent to a seed of value 1. Pointed out by: cem
This commit is contained in:
parent
cd7d06ac7e
commit
b9c52b50a7
1 changed files with 3 additions and 1 deletions
|
|
@ -3189,13 +3189,15 @@ static int
|
|||
rand(void)
|
||||
{
|
||||
|
||||
return (random() / 2 + 1);
|
||||
return (random());
|
||||
}
|
||||
|
||||
static void
|
||||
srand(unsigned int seed)
|
||||
{
|
||||
|
||||
if (seed == 0)
|
||||
seed = 1;
|
||||
srandom(seed);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue