mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
options: print empty options properly.
Noticed by log-prefix default (""), which causes bad JSON: ``` Malformed JSON reply '{"jsonrpc":"2.0","id":0,"result":{... "log-prefix":,"log-file":"log"} } ``` Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
68b45c2ae0
commit
ba4e9b64b5
@ -1556,7 +1556,7 @@ static void add_config(struct lightningd *ld,
|
||||
strcpy(buf + OPT_SHOW_LEN - 1, "...");
|
||||
|
||||
if (streq(buf, "true") || streq(buf, "false")
|
||||
|| strspn(buf, "0123456789.") == strlen(buf)) {
|
||||
|| (!streq(buf, "") && strspn(buf, "0123456789.") == strlen(buf))) {
|
||||
/* Let pure numbers and true/false through as
|
||||
* literals. */
|
||||
json_add_literal(response, name0,
|
||||
|
Loading…
Reference in New Issue
Block a user