summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorbar@noter.(none) <>2005-05-10 14:13:58 +0500
committerbar@noter.(none) <>2005-05-10 14:13:58 +0500
commit8a5c6502caf55a317ba86957b0ed7260d04201a5 (patch)
tree00ceeb7d833c89802e843cecb1398b1ea595487b /strings
parentb580a12d472d2019203972d7e6e7a15663f3598e (diff)
downloadmariadb-git-8a5c6502caf55a317ba86957b0ed7260d04201a5.tar.gz
bug#10344: some string function fail for UCS2
substr fix
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-ucs2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index f5d0721fa9b..f12cfe3256e 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1261,7 +1261,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;
}