mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 08:04:26 +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:
@@ -1556,7 +1556,7 @@ static void add_config(struct lightningd *ld,
|
|||||||
strcpy(buf + OPT_SHOW_LEN - 1, "...");
|
strcpy(buf + OPT_SHOW_LEN - 1, "...");
|
||||||
|
|
||||||
if (streq(buf, "true") || streq(buf, "false")
|
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
|
/* Let pure numbers and true/false through as
|
||||||
* literals. */
|
* literals. */
|
||||||
json_add_literal(response, name0,
|
json_add_literal(response, name0,
|
||||||
|
|||||||
Reference in New Issue
Block a user