summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-12-23 17:13:13 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-12-23 17:13:13 (GMT)
commitc651e4542854ee537853e142517b71cc88471bc2 (patch)
tree330461b0ef2fa3f190972d85a65036c3bf8d16e2 /generic/tclEncoding.c
parent55d2a945520134752ca2093461c1272fd08c32d2 (diff)
downloadtcl-c651e4542854ee537853e142517b71cc88471bc2.zip
tcl-c651e4542854ee537853e142517b71cc88471bc2.tar.gz
tcl-c651e4542854ee537853e142517b71cc88471bc2.tar.bz2
Support TCL_ENCODING_CHAR_LIMIT in the BinaryProc driver.
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 2a766d1..5c5254b 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -2131,6 +2131,9 @@ BinaryProc(
if (dstLen < 0) {
dstLen = 0;
}
+ if ((flags & TCL_ENCODING_CHAR_LIMIT) && srcLen > *dstCharsPtr) {
+ srcLen = *dstCharsPtr;
+ }
if (srcLen > dstLen) {
srcLen = dstLen;
result = TCL_CONVERT_NOSPACE;