Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit125d69c

Browse files
committed
Fix signed char in comparison and check memory allocation
1 parentad8c09c commit125d69c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎contrib/tsearch2/ispell/spell.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ strnduplicate(char *s, int len) {
4949
}
5050
/* backward string compaire for suffix tree operations */
5151
staticint
52-
strbcmp(constchar*s1,constchar*s2)
52+
strbcmp(constunsignedchar*s1,constunsignedchar*s2)
5353
{
5454
intl1=strlen(s1)-1,
5555
l2=strlen(s2)-1;
@@ -71,7 +71,7 @@ strbcmp(const char *s1, const char *s2)
7171
return0;
7272
}
7373
staticint
74-
strbncmp(constchar*s1,constchar*s2,size_tcount)
74+
strbncmp(constunsignedchar*s1,constunsignedchar*s2,size_tcount)
7575
{
7676
intl1=strlen(s1)-1,
7777
l2=strlen(s2)-1,
@@ -536,9 +536,10 @@ mkANode(IspellDict *Conf, int low, int high, int level, int type) {
536536
}
537537
data->val=GETCHAR(Conf->Affix+i,level,type );
538538
if (Conf->Affix[i].replen==level+1 ) {/* affix stopped */
539-
if ( !data->naff )
539+
if ( !data->naff ) {
540540
data->aff=(AFFIX**)malloc(sizeof(AFFIX*)*(high-i+1));
541-
MEMOUT(data);
541+
MEMOUT(data->aff);
542+
}
542543
data->aff[data->naff ]=Conf->Affix+i;
543544
data->naff++;
544545
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp