From 37590eeeb2ffbe6981d64078601f3592cd5b3a36 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 6 Dec 2022 10:20:26 +1030 Subject: [PATCH] common: fix arm32 compile breakage. It's obviously the incorrect type, while our CI didn't catch it, Nicholas did: ``` plugins/fetchinvoice.c:1362:30: error: conversion from 'long long unsigned int' to 'size_t' {aka 'unsigned int'} changes value from '18446744073709551615' to '4294967295' [-Werror=overflow] 1362 | || tlv_span(wire, 1001, UINT64_MAX, NULL) != 0) { ``` Reported-by: @NicholasDorier Signed-off-by: Rusty Russell Changelog-Fixed: Build: arm32 compiler error in fetchinvoice, due to bad types on 32-bit platforms. Fixes: #5776 --- common/bolt12.c | 2 +- common/bolt12.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/bolt12.c b/common/bolt12.c index e31b97f8c..4f1a5ab33 100644 --- a/common/bolt12.c +++ b/common/bolt12.c @@ -432,7 +432,7 @@ bool bolt12_has_prefix(const char *str) } /* Inclusive span of tlv range >= minfield and <= maxfield */ -size_t tlv_span(const u8 *tlvstream, size_t minfield, size_t maxfield, +size_t tlv_span(const u8 *tlvstream, u64 minfield, u64 maxfield, size_t *startp) { const u8 *cursor = tlvstream; diff --git a/common/bolt12.h b/common/bolt12.h index 80b43bb57..277a3f80b 100644 --- a/common/bolt12.h +++ b/common/bolt12.h @@ -135,7 +135,7 @@ bool bolt12_has_prefix(const char *str); * * Returns length, so 0 means nothing found. */ -size_t tlv_span(const u8 *tlvstream, size_t minfield, size_t maxfield, +size_t tlv_span(const u8 *tlvstream, u64 minfield, u64 maxfield, size_t *start); /* Get offer_id referred to by various structures. */