diff options
-rw-r--r-- | generic/tkIcu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tkIcu.c b/generic/tkIcu.c index 1e24698..cce440b 100644 --- a/generic/tkIcu.c +++ b/generic/tkIcu.c @@ -115,7 +115,7 @@ startEndOfCmd( if (idx > 0 && len != ulen) { /* The string contains codepoints > \uFFFF. Determine UTF-16 index */ Tcl_Size newIdx = 0; - for (Tcl_Size i = 0; i < index; i++) { + for (Tcl_Size i = 0; i < idx; i++) { newIdx += 1 + (((newIdx < (Tcl_Size)len-1) && (ustr[newIdx]&0xFC00) == 0xD800) && ((ustr[newIdx+1]&0xFC00) == 0xDC00)); } idx = newIdx; |