common: fix MacOS compile error.

clang 10.0.0 (erroneously?) claims an enum_side cannot be >= NUM_SIDES.
Make it clear that we're testing the raw u8 for validity.

Fixes: #4409
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2021-03-23 13:44:51 +10:30 committed by neil saitug
parent d06e84cceb
commit de52abbcde

View File

@ -253,7 +253,7 @@ void fromwire_changed_htlc(const u8 **cursor, size_t *max,
enum side fromwire_side(const u8 **cursor, size_t *max)
{
enum side side = fromwire_u8(cursor, max);
u8 side = fromwire_u8(cursor, max);
if (side >= NUM_SIDES) {
side = NUM_SIDES;
fromwire_fail(cursor, max);