aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag_pool.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-10-13 09:40:14 +0200
committerMax Kellermann <max@duempel.org>2008-10-13 09:40:14 +0200
commit8867bd554c6acd508d41f80457bac242a36e61fc (patch)
tree2e1685816d0d32259a87c461b92ad03d52932098 /src/tag_pool.c
parentc641aabe3385f2f3604dee622e0b92dc37be074c (diff)
downloadmpd-8867bd554c6acd508d41f80457bac242a36e61fc.tar.gz
mpd-8867bd554c6acd508d41f80457bac242a36e61fc.tar.xz
mpd-8867bd554c6acd508d41f80457bac242a36e61fc.zip
tag_item: avoid wasting space when struct is unpackable
Not all compilers support struct packing, and those that don't shouldn't be punished for it.
Diffstat (limited to 'src/tag_pool.c')
-rw-r--r--src/tag_pool.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tag_pool.c b/src/tag_pool.c
index 257458795..dc2e0df2b 100644
--- a/src/tag_pool.c
+++ b/src/tag_pool.c
@@ -69,7 +69,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;