mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 11:59:16 +01:00
log: Add termination to prefix log
This commit is contained in:
parent
ed7624e4f9
commit
47a7b4a55b
2 changed files with 3 additions and 2 deletions
|
@ -614,7 +614,8 @@ static char *arg_log_prefix(const char *arg, struct log *log)
|
|||
|
||||
static void show_log_prefix(char buf[OPT_SHOW_LEN], const struct log *log)
|
||||
{
|
||||
strncpy(buf, log->prefix->prefix, OPT_SHOW_LEN);
|
||||
strncpy(buf, log->prefix->prefix, OPT_SHOW_LEN - 1);
|
||||
buf[OPT_SHOW_LEN - 1] = '\0';
|
||||
}
|
||||
|
||||
static int signalfds[2];
|
||||
|
|
|
@ -1537,8 +1537,8 @@ static void add_config(struct lightningd *ld,
|
|||
if (opt->desc == opt_hidden) {
|
||||
/* Ignore hidden options (deprecated) */
|
||||
} else if (opt->show) {
|
||||
strcpy(buf + OPT_SHOW_LEN, "...");
|
||||
opt->show(buf, opt->u.carg);
|
||||
strcpy(buf + OPT_SHOW_LEN - 1, "...");
|
||||
|
||||
if (streq(buf, "true") || streq(buf, "false")
|
||||
|| strspn(buf, "0123456789.") == strlen(buf)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue