mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
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:
committed by
neil saitug
parent
d06e84cceb
commit
de52abbcde
@@ -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 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) {
|
if (side >= NUM_SIDES) {
|
||||||
side = NUM_SIDES;
|
side = NUM_SIDES;
|
||||||
fromwire_fail(cursor, max);
|
fromwire_fail(cursor, max);
|
||||||
|
|||||||
Reference in New Issue
Block a user