summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
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;
}