summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-10-02 14:46:54 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-10-02 14:46:54 (GMT)
commite500dec9fd8fb77231632352b45d2b0b715cdc22 (patch)
tree20a24e30d261d0bdfb0cea41eb93b3bf9d58a336 /generic
parentf987a699e563dd24c0a755d48e0169ac059a5536 (diff)
parenta21e1b769836e5b589d00985420d87e74c8010e3 (diff)
downloadtcl-e500dec9fd8fb77231632352b45d2b0b715cdc22.zip
tcl-e500dec9fd8fb77231632352b45d2b0b715cdc22.tar.gz
tcl-e500dec9fd8fb77231632352b45d2b0b715cdc22.tar.bz2
[bc5b790099] Improper calculation of new dstLimit value. New test io-12.7.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIO.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index dcde8d1..aea633c 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -6046,12 +6046,11 @@ ReadChars(
/*
* We read more chars than allowed. Reset limits to
* prevent that and try again. Don't forget the extra
- * padding of TCL_UTF_MAX - 1 bytes demanded by the
+ * padding of TCL_UTF_MAX bytes demanded by the
* Tcl_ExternalToUtf() call!
*/
- dstLimit = Tcl_UtfAtIndex(dst, charsToRead + 1)
- + TCL_UTF_MAX - 1 - dst;
+ dstLimit = Tcl_UtfAtIndex(dst, charsToRead) + TCL_UTF_MAX - dst;
statePtr->flags = savedFlags;
statePtr->inputEncodingFlags = savedIEFlags;
statePtr->inputEncodingState = savedState;