Skip to content

Commit

Permalink
test_proto: avoid -Wconversion warning
Browse files Browse the repository at this point in the history
Instead of magic constant say what we want to say.
So that randrange also produces the correct output
type.

Signed-off-by: Frank Lichtenheld <[email protected]>
  • Loading branch information
flichtenheld committed Oct 11, 2023
1 parent 73624b8 commit 227a8e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/unittests/test_proto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 227a8e7

Please sign in to comment.