summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <bar@noter.(none)>2005-05-10 14:13:58 +0500
committerunknown <bar@noter.(none)>2005-05-10 14:13:58 +0500
commita91cf275c872477242d8d036004abd521aaa0978 (patch)
tree00ceeb7d833c89802e843cecb1398b1ea595487b /strings
parent1fb790d3f096b43f67fdfb2ee9ddd8847d8bb1a6 (diff)
downloadmariadb-git-a91cf275c872477242d8d036004abd521aaa0978.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;
}