summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2003-12-18 19:27:53 +0000
committerTeodor Sigaev <teodor@sigaev.ru>2003-12-18 19:27:53 +0000
commit125d69cd9b2a78a53b9cac811b3f028d6f1ea3d2 (patch)
tree69fbd0de570fad294d9f9914a583b598717c8350
parentad8c09c29c5aa00efabb3fdbffc7a25ed7ded742 (diff)
Fix signed char in comparison and check memory allocation
-rw-r--r--contrib/tsearch2/ispell/spell.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/tsearch2/ispell/spell.c b/contrib/tsearch2/ispell/spell.c
index 331204ece32..4f4b332933d 100644
--- a/contrib/tsearch2/ispell/spell.c
+++ b/contrib/tsearch2/ispell/spell.c
@@ -49,7 +49,7 @@ strnduplicate(char *s, int len) {
}
/* backward string compaire for suffix tree operations */
static int
-strbcmp(const char *s1, const char *s2)
+strbcmp(const unsigned char *s1, const unsigned char *s2)
{
int l1 = strlen(s1) - 1,
l2 = strlen(s2) - 1;
@@ -71,7 +71,7 @@ strbcmp(const char *s1, const char *s2)
return 0;
}
static int
-strbncmp(const char *s1, const char *s2, size_t count)
+strbncmp(const unsigned char *s1, const unsigned char *s2, size_t count)
{
int l1 = strlen(s1) - 1,
l2 = strlen(s2) - 1,
@@ -536,9 +536,10 @@ mkANode(IspellDict *Conf, int low, int high, int level, int type) {
}
data->val=GETCHAR( Conf->Affix + i, level, type );
if ( Conf->Affix[i].replen == level+1 ) { /* affix stopped */
- if ( !data->naff )
+ if ( !data->naff ) {
data->aff=(AFFIX**)malloc(sizeof(AFFIX*)*(high-i+1));
- MEMOUT(data);
+ MEMOUT(data->aff);
+ }
data->aff[ data->naff ] = Conf->Affix + i;
data->naff++;
}