0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 04:02:15 +02:00

test_proto: avoid -Wconversion warning

Instead of magic constant say what we want to say.
So that randrange also produces the correct output
type.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
This commit is contained in:
Frank Lichtenheld 2023-09-29 16:09:01 +02:00
parent 73624b8331
commit 227a8e7a65

View File

@ -803,7 +803,7 @@ class NoisyWire
std::cout << now->raw() << " " << title << " Simulating a corrupted packet" << std::endl;
#endif
const size_t pos = random.randrange(bp->size());
const unsigned char value = random.randrange(256);
const unsigned char value = random.randrange(std::numeric_limits<unsigned char>::max());
(*bp)[pos] = value;
}
#endif