From aed02f0fedf56f6684cb98e33d0c616d4f80e81f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 11 Oct 2008 20:15:43 -0700 Subject: 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. --- src/tag_pool.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/tag_pool.c') 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; -- cgit v1.2.3