mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
json: fix 32-bit build.
Assume we have strtoull everywhere (it's C99 and was common before). Fixes: #91 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
34b4134cb0
commit
5465b61784
@ -45,9 +45,9 @@ bool json_tok_u64(const char *buffer, const jsmntok_t *tok,
|
||||
uint64_t *num)
|
||||
{
|
||||
char *end;
|
||||
unsigned long l;
|
||||
unsigned long long l;
|
||||
|
||||
l = strtoul(buffer + tok->start, &end, 0);
|
||||
l = strtoull(buffer + tok->start, &end, 0);
|
||||
if (end != buffer + tok->end)
|
||||
return false;
|
||||
|
||||
@ -55,7 +55,7 @@ bool json_tok_u64(const char *buffer, const jsmntok_t *tok,
|
||||
*num = l;
|
||||
|
||||
/* Check for overflow */
|
||||
if (l == ULONG_MAX && errno == ERANGE)
|
||||
if (l == ULLONG_MAX && errno == ERANGE)
|
||||
return false;
|
||||
|
||||
if (*num != l)
|
||||
|
Loading…
Reference in New Issue
Block a user