json: fix json_tok_bitcoin_amount()

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-01-04 17:02:01 +10:30 committed by Christian Decker
parent 9a8eca4fee
commit 86e1a61165
1 changed files with 1 additions and 1 deletions

View File

@ -100,7 +100,7 @@ bool json_tok_bitcoin_amount(const char *buffer, const jsmntok_t *tok,
return false;
if (end != buffer + tok->end) {
/* Expect always 8 decimal places. */
if (*end != '.' || buffer + tok->start - end != 9)
if (*end != '.' || buffer + tok->end - end != 9)
return false;
sat = strtoul(end+1, &end, 0);
if (sat == ULONG_MAX && errno == ERANGE)