From 22f465dabedfc2484981c95101c063ed81b64aaf Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 6 Jun 2001 16:10:28 +0000 Subject: [PATCH] use field_offset to hide the nastyness --- libs/util/hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/util/hash.c b/libs/util/hash.c index 34dc2c53e..47c084f20 100644 --- a/libs/util/hash.c +++ b/libs/util/hash.c @@ -72,7 +72,7 @@ hashtab_t * Hash_NewTable (int tsize, const char *(*gk)(void*,void*), void (*f)(void*,void*), void *ud) { - hashtab_t *tab = calloc (1, (size_t)&((hashtab_t*)0)->tab[tsize]); + hashtab_t *tab = calloc (1, field_offset (hashtab_t, tab[tsize])); if (!tab) return 0; tab->tab_size = tsize;