tag: tags_expand_template(): return NULL if template is NULL

This commit is contained in:
Daniel Eklöf 2018-12-29 17:10:54 +01:00
parent 85801a5deb
commit 32b4e9986d

4
tag.c
View file

@ -399,8 +399,10 @@ sbuf_strcat(struct sbuf *s1, const char *s2)
char * char *
tags_expand_template(const char *template, const struct tag_set *tags) tags_expand_template(const char *template, const struct tag_set *tags)
{ {
struct sbuf formatted = {0}; if (template == NULL)
return NULL;
struct sbuf formatted = {0};
while (true) { while (true) {
/* Find next tag opening '{' */ /* Find next tag opening '{' */
const char *begin = strchr(template, '{'); const char *begin = strchr(template, '{');