mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 23:54:22 +01:00
common/utils: add tal_strdup_or_null helper.
It's not that uncommon to want to pass NULL through, for optional strings. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -13,10 +13,7 @@ struct configvar *configvar_new(const tal_t *ctx,
|
||||
const char *configline)
|
||||
{
|
||||
struct configvar *cv = tal(ctx, struct configvar);
|
||||
if (file)
|
||||
cv->file = tal_strdup(cv, file);
|
||||
else
|
||||
cv->file = NULL;
|
||||
cv->file = tal_strdup_or_null(cv, file);
|
||||
cv->src = src;
|
||||
cv->linenum = linenum;
|
||||
cv->configline = tal_strdup(cv, configline);
|
||||
|
||||
Reference in New Issue
Block a user