From 86e1a61165c5d358beefba44758f3b17293601e6 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 4 Jan 2018 17:02:01 +1030 Subject: [PATCH] json: fix json_tok_bitcoin_amount() Signed-off-by: Rusty Russell --- common/json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/json.c b/common/json.c index 1c037d24c..c06a32fa8 100644 --- a/common/json.c +++ b/common/json.c @@ -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)