summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 6cec532..b6c6571 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -3234,7 +3234,7 @@ UtfToUtf16Proc(
}
dstStart = dst;
- dstEnd = dst + dstLen - sizeof(Tcl_UniChar);
+ dstEnd = dst + dstLen - 2; /* 2 -> sizeof a UTF-16 code unit */
flags |= PTR2INT(clientData);
result = TCL_OK;
@@ -3344,7 +3344,7 @@ UtfToUcs2Proc(
}
dstStart = dst;
- dstEnd = dst + dstLen - sizeof(Tcl_UniChar);
+ dstEnd = dst + dstLen - 2; /* 2 - size of UCS code unit */
result = TCL_OK;
for (numChars = 0; src < srcEnd; numChars++) {