Skip to content

Commit

Permalink
common: fix arm32 compile breakage.
Browse files Browse the repository at this point in the history
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 <rusty@rustcorp.com.au>
Changelog-Fixed: Build: arm32 compiler error in fetchinvoice, due to bad types on 32-bit platforms.
Fixes: ElementsProject#5776
  • Loading branch information
rustyrussell authored and ddustin committed May 12, 2023
1 parent 55e6898 commit 9acb449
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common/bolt12.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion common/bolt12.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 9acb449

Please sign in to comment.