summaryrefslogtreecommitdiffstats
path: root/generic/tclUtf.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r--generic/tclUtf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index 9596aed..c7f8a94 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -937,7 +937,9 @@ Tcl_UniCharAtIndex(
{
Tcl_UniChar ch = 0;
- TclUtfToUniChar(Tcl_UtfAtIndex(src, index), &ch);
+ while (index-- >= 0) {
+ src += TclUtfToUniChar(src, &ch);
+ }
return ch;
}