Use only rand(), not random().
We used both rand() and random() in our code. Since it returns an int, we have to use %x in our format strings instead of %lx. This fixes a crash under Windows when cross-compiling tinc with a recent version of MinGW.
This commit is contained in:
parent
75773efe26
commit
35e87b903e
4 changed files with 6 additions and 6 deletions
|
|
@ -87,7 +87,7 @@ void send_mtu_probe(node_t *n)
|
|||
return;
|
||||
}
|
||||
|
||||
len = n->minmtu + 1 + random() % (n->maxmtu - n->minmtu);
|
||||
len = n->minmtu + 1 + rand() % (n->maxmtu - n->minmtu);
|
||||
if(len < 64)
|
||||
len = 64;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue