mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 16:44:20 +01:00
lightning-cli: fix handling of complex objects with -H.
I crashed it using `-H listconfigs` Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Fixed: cli: fixed crash with `listconfigs` in `-H` mode
This commit is contained in:
committed by
neil saitug
parent
5bac63c6a3
commit
fb013f9d02
@@ -65,7 +65,7 @@ static size_t human_readable(const char *buffer, const jsmntok_t *t, char term)
|
||||
case JSMN_OBJECT:
|
||||
/* Elide single-field objects */
|
||||
if (t->size == 1)
|
||||
return human_readable(buffer, t + 2, '\n') + 3;
|
||||
return human_readable(buffer, t + 2, '\n') + 2;
|
||||
n = 1;
|
||||
for (i = 0; i < t->size; i++) {
|
||||
n += human_readable(buffer, t + n, '=');
|
||||
|
||||
Reference in New Issue
Block a user