diff options
-rw-r--r-- | generic/tclEncoding.c | 3 |
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; |