diff options
| author | apnadkarni <apnmbx-wits@yahoo.com> | 2023-03-30 18:01:48 (GMT) |
|---|---|---|
| committer | apnadkarni <apnmbx-wits@yahoo.com> | 2023-03-30 18:01:48 (GMT) |
| commit | 5a1359a5e8aa149cea117f4f34239cd3a23872f4 (patch) | |
| tree | 85a0e53462d5b6da6b74451e0c3f9d59004369ed /generic/tclEncoding.c | |
| parent | edb3e7b8d2efcb3a1282f910f1e7120d5d34c6f8 (diff) | |
| download | tcl-5a1359a5e8aa149cea117f4f34239cd3a23872f4.zip tcl-5a1359a5e8aa149cea117f4f34239cd3a23872f4.tar.gz tcl-5a1359a5e8aa149cea117f4f34239cd3a23872f4.tar.bz2 | |
TIP 660. No compiler warnings. Tests suite pass on Win and Ubuntu
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 a87eb7f..7deed75 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) { |
