diff options
Diffstat (limited to '')
-rw-r--r-- | src/tag.h | 2 | ||||
-rw-r--r-- | src/tag_pool.c | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -42,7 +42,7 @@ extern const char *mpdTagItemKeys[]; struct tag_item { enum tag_type type; - char value[1]; + char value[mpd_sizeof_str_flex_array]; } mpd_packed; struct mpd_tag { diff --git a/src/tag_pool.c b/src/tag_pool.c index d227a2988..1d92502cc 100644 --- a/src/tag_pool.c +++ b/src/tag_pool.c @@ -67,7 +67,9 @@ static struct slot *slot_alloc(struct slot *next, enum tag_type type, const char *value, int length) { - struct slot *slot = xmalloc(sizeof(*slot) + length); + struct slot *slot; + + slot = xmalloc(sizeof(*slot) - sizeof(slot->item.value) + length + 1); slot->next = next; slot->ref = 1; slot->item.type = type; |