summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorkonstantin@mysql.com <>2005-05-14 12:38:12 +0400
committerkonstantin@mysql.com <>2005-05-14 12:38:12 +0400
commit89bd09fed2565f0e509a9d81ca7e9782ff1f8ea1 (patch)
tree301d852032306dc5560a6076b889c4d7c3d6da7d /strings
parent3ff39b3704b4b0023ab107217ec36fe578f26e4d (diff)
parent6c981c0b8005a1577c7dfd93eb656a5da46ef9f0 (diff)
downloadmariadb-git-89bd09fed2565f0e509a9d81ca7e9782ff1f8ea1.tar.gz
Manual merge (again)
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-big5.c2
-rw-r--r--strings/ctype-ucs2.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index e12ff189eaf..447eea3e635 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -6301,7 +6301,7 @@ uint my_well_formed_len_big5(CHARSET_INFO *cs __attribute__((unused)),
const char *emb= e - 1; /* Last possible end of an MB character */
*error= 0;
- while (pos && b < e)
+ while (pos-- && b < e)
{
if ((uchar) b[0] < 128)
{
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index d15144b7438..e57ad8e7d69 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1267,7 +1267,7 @@ uint my_charpos_ucs2(CHARSET_INFO *cs __attribute__((unused)),
const char *e __attribute__((unused)),
uint pos)
{
- return pos*2;
+ return pos > e - b ? e - b + 2 : pos * 2;
}