summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2007-09-11 13:06:28 +0000
committerTeodor Sigaev <teodor@sigaev.ru>2007-09-11 13:06:28 +0000
commit8605cfaa3dc526d548cbe4d7d1e0b6e4a56abdb0 (patch)
treeb5b0155a360f087e3055df413ca8211050477a6e
parente52f4ec325c08f11739607b4571dba040c9075a9 (diff)
Fix header's size of structs defines in ispell.
-rw-r--r--contrib/tsearch2/ispell/spell.c4
-rw-r--r--contrib/tsearch2/ispell/spell.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/contrib/tsearch2/ispell/spell.c b/contrib/tsearch2/ispell/spell.c
index 7fb720f582c..9027263a18d 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 ee86eac9856..549bb68091f 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
{