forked from external/yambar
tag: tag_new_string(): allow NULL values (treat as empty string)
This commit is contained in:
parent
7f2c0681a7
commit
3bc4bd56a9
1 changed files with 1 additions and 1 deletions
2
tag.c
2
tag.c
|
@ -262,7 +262,7 @@ tag_new_string(const char *name, const char *value)
|
||||||
{
|
{
|
||||||
struct private *priv = malloc(sizeof(*priv));
|
struct private *priv = malloc(sizeof(*priv));
|
||||||
priv->name = strdup(name);
|
priv->name = strdup(name);
|
||||||
priv->value_as_string = strdup(value);
|
priv->value_as_string = value != NULL ? strdup(value) : strdup("");
|
||||||
|
|
||||||
struct tag *tag = malloc(sizeof(*tag));
|
struct tag *tag = malloc(sizeof(*tag));
|
||||||
tag->private = priv;
|
tag->private = priv;
|
||||||
|
|
Loading…
Add table
Reference in a new issue