Skip to content

Commit

Permalink
lightningd: better short daemon name w/ tal_strdup.
Browse files Browse the repository at this point in the history
  • Loading branch information
ksedgwic committed Jan 31, 2020
1 parent a001b58 commit a8f5cdc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lightningd/lightningd.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,7 @@ const char *subdaemon_path(const tal_t *ctx, const struct lightningd *ld, const
*/
size_t pfxlen = strlen("lightning_");
assert(strlen(name) > pfxlen);
const char *short_name =
tal_strndup(ctx, name + pfxlen, strlen(name) - pfxlen);
const char *short_name = tal_strdup(ctx, name + pfxlen);

/* Is there an alternate path for this subdaemon? */
const char *dpath;
Expand Down

0 comments on commit a8f5cdc

Please sign in to comment.