From: Teodor Sigaev Date: Tue, 11 Sep 2007 13:06:28 +0000 (+0000) Subject: Fix header's size of structs defines in ispell. X-Git-Tag: REL8_1_10~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8605cfaa3dc526d548cbe4d7d1e0b6e4a56abdb0;p=postgresql Fix header's size of structs defines in ispell. --- diff --git a/contrib/tsearch2/ispell/spell.c b/contrib/tsearch2/ispell/spell.c index 7fb720f582..9027263a18 100644 --- a/contrib/tsearch2/ispell/spell.c +++ b/contrib/tsearch2/ispell/spell.c @@ -463,9 +463,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 ee86eac985..549bb68091 100644 --- a/contrib/tsearch2/ispell/spell.h +++ b/contrib/tsearch2/ispell/spell.h @@ -27,7 +27,7 @@ typedef struct SPNode SPNodeData data[1]; } SPNode; -#define SPNHRDSZ (sizeof(uint32)) +#define SPNHDRSZ (offsetof(SPNode,data)) typedef struct spell_struct @@ -89,7 +89,7 @@ typedef struct AffixNode AffixNodeData data[1]; } AffixNode; -#define ANHRDSZ (sizeof(uint32)) +#define ANHRDSZ (offsetof(AffixNode, data)) typedef struct {