mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
param: upgraded json_tok_bool
Signed-off-by: Mark Beckwith <wythe@intrig.com>
This commit is contained in:
committed by
Rusty Russell
parent
e5918f4e5a
commit
8ebc95b7b0
@@ -141,23 +141,6 @@ bool json_tok_is_null(const char *buffer, const jsmntok_t *tok)
|
||||
return buffer[tok->start] == 'n';
|
||||
}
|
||||
|
||||
bool json_tok_bool(const char *buffer, const jsmntok_t *tok, bool *b)
|
||||
{
|
||||
if (tok->type != JSMN_PRIMITIVE)
|
||||
return false;
|
||||
if (tok->end - tok->start == strlen("true")
|
||||
&& memcmp(buffer + tok->start, "true", strlen("true")) == 0) {
|
||||
*b = true;
|
||||
return true;
|
||||
}
|
||||
if (tok->end - tok->start == strlen("false")
|
||||
&& memcmp(buffer + tok->start, "false", strlen("false")) == 0) {
|
||||
*b = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool json_tok_sha256(const char *buffer, const jsmntok_t * tok,
|
||||
struct sha256 *hash)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user