From de52abbcde60e8b230cf6220590c9ee88a028e33 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 23 Mar 2021 13:44:51 +1030 Subject: [PATCH] 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 --- common/htlc_wire.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/htlc_wire.c b/common/htlc_wire.c index 1e1f63f22..3abdfb706 100644 --- a/common/htlc_wire.c +++ b/common/htlc_wire.c @@ -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);