From 13ad48eb8a49bbba4e13026ed69f07a51d52d244 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Tue, 11 Sep 2007 13:15:41 +0000 Subject: [PATCH] Fix header's size of structs defines in ispell. --- contrib/tsearch2/ispell/spell.c | 4 ++-- contrib/tsearch2/ispell/spell.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/tsearch2/ispell/spell.c b/contrib/tsearch2/ispell/spell.c index 0d8d072ae5c..a497cf51d1b 100644 --- a/contrib/tsearch2/ispell/spell.c +++ b/contrib/tsearch2/ispell/spell.c @@ -461,9 +461,9 @@ mkSPNode(IspellDict * Conf, int low, int high, int level) if (!nchar) return NULL; - rs = (SPNode *) malloc(SPNHRDSZ + nchar * sizeof(SPNodeData)); + rs = (SPNode *) malloc(SPNHDRSZ + nchar * sizeof(SPNodeData)); MEMOUT(rs); - memset(rs, 0, SPNHRDSZ + nchar * sizeof(SPNodeData)); + memset(rs, 0, SPNHDRSZ + nchar * sizeof(SPNodeData)); rs->length = nchar; data = rs->data; diff --git a/contrib/tsearch2/ispell/spell.h b/contrib/tsearch2/ispell/spell.h index cc7935fd743..9ca2db5c5f1 100644 --- a/contrib/tsearch2/ispell/spell.h +++ b/contrib/tsearch2/ispell/spell.h @@ -26,7 +26,7 @@ typedef struct SPNode SPNodeData data[1]; } SPNode; -#define SPNHRDSZ (sizeof(uint32)) +#define SPNHDRSZ (offsetof(SPNode,data)) typedef struct spell_struct @@ -88,7 +88,7 @@ typedef struct AffixNode AffixNodeData data[1]; } AffixNode; -#define ANHRDSZ (sizeof(uint32)) +#define ANHRDSZ (offsetof(AffixNode, data)) typedef struct { -- 2.39.5