diff options
author | dgp <dgp@users.sourceforge.net> | 2014-03-07 20:15:12 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-03-07 20:15:12 (GMT) |
commit | 83f5493faa96da87b5327be1f49e432f5a870879 (patch) | |
tree | 7e5eb0da95e439ba720b2195280dec7dc6b77d80 /generic | |
parent | a895183137cb5e741f92353116465a9e27c432e4 (diff) | |
download | tcl-83f5493faa96da87b5327be1f49e432f5a870879.zip tcl-83f5493faa96da87b5327be1f49e432f5a870879.tar.gz tcl-83f5493faa96da87b5327be1f49e432f5a870879.tar.bz2 |
TranslateInputEOL() callers no longer need assert dstLen <= srcLen.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclIO.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index 03aac32..d23ca03 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -5330,7 +5330,8 @@ ReadChars( * Capture the number of bytes actually consumed in dstRead. */ - dstWrote = dstRead = dstDecoded; + dstWrote = dstLimit; + dstRead = dstDecoded; TranslateInputEOL(statePtr, dst, dst, &dstWrote, &dstRead); if (dstRead < dstDecoded) { @@ -8852,14 +8853,11 @@ CopyAndTranslateBuffer( } bufPtr = statePtr->inQueueHead; bytesInBuffer = BytesLeft(bufPtr); + if (bytesInBuffer == 0) { + return 0; + } copied = space; - if (bytesInBuffer <= copied) { - copied = bytesInBuffer; - } - if (copied == 0) { - return copied; - } TranslateInputEOL(statePtr, result, RemovePoint(bufPtr), &copied, &bytesInBuffer); bufPtr->nextRemoved += bytesInBuffer; |