summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2008-07-04 19:21:14 (GMT)
committerjenglish <jenglish@flightlab.com>2008-07-04 19:21:14 (GMT)
commit55aaafebf11934aa7c0820362b78688e70c95438 (patch)
tree2dd491b430d34403df3774b0cdad677d3a2533b5 /generic/tclEncoding.c
parent249cb51f56621900b972cbbc766b6a4afe7a5331 (diff)
downloadtcl-55aaafebf11934aa7c0820362b78688e70c95438.zip
tcl-55aaafebf11934aa7c0820362b78688e70c95438.tar.gz
tcl-55aaafebf11934aa7c0820362b78688e70c95438.tar.bz2
UtfToUtfProc: Avoid unwanted sign extension when converting incomplete UTF-8
sequences. See [Bug 1908443] for details.
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 1a3faa3..99c71b0 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclEncoding.c,v 1.16.2.14 2007/02/12 19:25:42 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclEncoding.c,v 1.16.2.15 2008/07/04 19:21:19 jenglish Exp $
*/
#include "tclInt.h"
@@ -2084,11 +2084,11 @@ UtfToUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen,
} else if (!Tcl_UtfCharComplete(src, srcEnd - src)) {
/* Always check before using Tcl_UtfToUniChar. Not doing
* can so cause it run beyond the endof the buffer! If we
- * * happen such an incomplete char its byts are made to *
+ * happen such an incomplete char its bytes are made to
* represent themselves.
*/
- ch = (Tcl_UniChar) *src;
+ ch = (unsigned char) *src;
src += 1;
dst += Tcl_UniCharToUtf(ch, dst);
} else {