diff options
| author | apnadkarni <apnmbx-wits@yahoo.com> | 2023-04-19 09:18:32 (GMT) |
|---|---|---|
| committer | apnadkarni <apnmbx-wits@yahoo.com> | 2023-04-19 09:18:32 (GMT) |
| commit | ae3ae231d062923a954f46ee5d854b7cb1ed3360 (patch) | |
| tree | ee4764a682218ba0762817716723101f26a5155f /generic/tclEncoding.c | |
| parent | d87bc3c2f0cc186486e5c0fee0dc59a8e952cbaa (diff) | |
| parent | d4dd40b364d4b3e6a4fa9e5b26c65d79e7d3d58d (diff) | |
| download | tcl-ae3ae231d062923a954f46ee5d854b7cb1ed3360.zip tcl-ae3ae231d062923a954f46ee5d854b7cb1ed3360.tar.gz tcl-ae3ae231d062923a954f46ee5d854b7cb1ed3360.tar.bz2 | |
Merge trunk
Diffstat (limited to 'generic/tclEncoding.c')
| -rw-r--r-- | generic/tclEncoding.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 9b1894e..fca4ea5 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -1415,9 +1415,9 @@ Tcl_ExternalToUtf( } if (!noTerminate) { - if ((int) dstLen < 1) { - return TCL_CONVERT_NOSPACE; - } + if (dstLen < 1) { + return TCL_CONVERT_NOSPACE; + } /* * If there are any null characters in the middle of the buffer, * they will converted to the UTF-8 null character (\xC0\x80). To get @@ -1612,9 +1612,9 @@ Tcl_UtfToExternalDStringEx( if ((result != TCL_CONVERT_NOSPACE) && !(result == TCL_CONVERT_MULTIBYTE && (flags & TCL_ENCODING_END))) { Tcl_Size nBytesProcessed = (src - srcStart); - size_t i = soFar + encodingPtr->nullSize - 1; + Tcl_Size i = soFar + encodingPtr->nullSize - 1; /* Loop as DStringSetLength only stores one nul byte at a time */ - while (i+1 >= soFar+1) { + while (i >= soFar) { Tcl_DStringSetLength(dstPtr, i--); } if (errorLocPtr) { |
