diff options
author | unknown <serg@serg.mylan> | 2003-08-21 20:13:26 +0200 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2003-08-21 20:13:26 +0200 |
commit | c7614597ab5b7145c9ea816f09374f46747ea125 (patch) | |
tree | be33643e7552c4bf4e8506def5b775aa90ecf968 /strings | |
parent | 943233632e6afb8ad5da2c654cd2462b53db2563 (diff) | |
download | mariadb-git-c7614597ab5b7145c9ea816f09374f46747ea125.tar.gz |
crash BUG#1116 fixed
Diffstat (limited to 'strings')
-rw-r--r-- | strings/ctype-tis620.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index 885d4406cd6..edadadf3a43 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -49,7 +49,7 @@ #include "m_ctype.h" #include "t_ctype.h" -static uchar* thai2sortable(const uchar *tstr,uint len); +static uchar* thai2sortable(const uchar *tstr,int len); #define BUFFER_MULTIPLY 4 #define buffsize(s) (BUFFER_MULTIPLY * (strlen(s) + 1)) @@ -456,7 +456,7 @@ uchar NEAR sort_order_tis620[]= /* NOTE: isn't it faster to alloc buffer in calling function? */ -static uchar* thai2sortable(const uchar * tstr,uint len) +static uchar* thai2sortable(const uchar * tstr,int len) { /* We use only 3 levels (neglect capitalization). */ @@ -467,16 +467,16 @@ static uchar* thai2sortable(const uchar * tstr,uint len) uint bufSize; uint RightSize; - len= (uint) strnlen((char*) tstr,len); + len= (int) strnlen((char*) tstr,len); bufSize= (uint) buffsize((char*) tstr); RightSize= sizeof(uchar) * (len + 1); - if (!(outBuf= pLeft1= pRight1= + if (!(outBuf= pLeft1= pRight1= (uchar *)malloc(sizeof(uchar) * bufSize + RightSize*2))) return (uchar*) tstr; pLeft2= pRight2= pRight1 + sizeof(uchar) * bufSize; pLeft3= pRight3= pRight2 + RightSize; - while (--len) + while (--len > 0) { int *t_ctype0= t_ctype[p[0]]; if (isldvowel(*p) && isconsnt(p[1])) @@ -567,8 +567,8 @@ int my_strcoll_tis620(const uchar * s1, const uchar * s2) { uchar *tc1, *tc2; int i; - tc1= thai2sortable(s1, (uint) strlen((char*)s1)); - tc2= thai2sortable(s2, (uint) strlen((char*)s2)); + tc1= thai2sortable(s1, (int) strlen((char*)s1)); + tc2= thai2sortable(s2, (int) strlen((char*)s2)); i= strcmp((char*)tc1, (char*)tc2); free(tc1); free(tc2); |