summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-06-08 08:26:58 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-06-08 08:26:58 (GMT)
commit2ab08afabdfc1091ae69439fb7c8bf81e8729e3e (patch)
tree5d0ad393849e7c2d6b1b88d3f6d413ff2b505f14 /generic/tclEncoding.c
parent68be5b2b62dfcf1b9b7e348a71c4d88e08f19ef9 (diff)
downloadtcl-2ab08afabdfc1091ae69439fb7c8bf81e8729e3e.zip
tcl-2ab08afabdfc1091ae69439fb7c8bf81e8729e3e.tar.gz
tcl-2ab08afabdfc1091ae69439fb7c8bf81e8729e3e.tar.bz2
Better UTF-8 surrogate handling, only functional when TCL_UTF_MAX>3
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index b4acb5f..8450128 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -2296,7 +2296,7 @@ UtfToUtfProc(
const char *srcStart, *srcEnd, *srcClose;
const char *dstStart, *dstEnd;
int result, numChars, charLimit = INT_MAX;
- Tcl_UniChar ch;
+ Tcl_UniChar ch = 0;
result = TCL_OK;
@@ -2345,8 +2345,8 @@ UtfToUtfProc(
} else if (!Tcl_UtfCharComplete(src, srcEnd - src)) {
/*
* Always check before using TclUtfToUniChar. Not doing can so
- * cause it run beyond the endof the buffer! If we happen such an
- * incomplete char its byts are made to represent themselves.
+ * cause it run beyond the end of the buffer! If we happen such an
+ * incomplete char its bytes are made to represent themselves.
*/
ch = (unsigned char) *src;
@@ -2410,7 +2410,7 @@ UnicodeToUtfProc(
const char *srcStart, *srcEnd;
const char *dstEnd, *dstStart;
int result, numChars, charLimit = INT_MAX;
- Tcl_UniChar ch;
+ Tcl_UniChar ch = 0;
if (flags & TCL_ENCODING_CHAR_LIMIT) {
charLimit = *dstCharsPtr;
@@ -2500,7 +2500,7 @@ UtfToUnicodeProc(
{
const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd;
int result, numChars;
- Tcl_UniChar ch;
+ Tcl_UniChar ch = 0;
srcStart = src;
srcEnd = src + srcLen;
@@ -2610,7 +2610,7 @@ TableToUtfProc(
const char *srcStart, *srcEnd;
const char *dstEnd, *dstStart, *prefixBytes;
int result, byte, numChars, charLimit = INT_MAX;
- Tcl_UniChar ch;
+ Tcl_UniChar ch = 0;
const unsigned short *const *toUnicode;
const unsigned short *pageZero;
TableEncodingData *dataPtr = clientData;
@@ -2722,7 +2722,7 @@ TableFromUtfProc(
{
const char *srcStart, *srcEnd, *srcClose;
const char *dstStart, *dstEnd, *prefixBytes;
- Tcl_UniChar ch;
+ Tcl_UniChar ch = 0;
int result, len, word, numChars;
TableEncodingData *dataPtr = clientData;
const unsigned short *const *fromUnicode;
@@ -2856,7 +2856,7 @@ Iso88591ToUtfProc(
result = TCL_OK;
for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
- Tcl_UniChar ch;
+ Tcl_UniChar ch = 0;
if (dst > dstEnd) {
result = TCL_CONVERT_NOSPACE;
@@ -2942,7 +2942,7 @@ Iso88591FromUtfProc(
dstEnd = dst + dstLen - 1;
for (numChars = 0; src < srcEnd; numChars++) {
- Tcl_UniChar ch;
+ Tcl_UniChar ch = 0;
int len;
if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
@@ -3329,7 +3329,7 @@ EscapeFromUtfProc(
for (numChars = 0; src < srcEnd; numChars++) {
unsigned len;
int word;
- Tcl_UniChar ch;
+ Tcl_UniChar ch = 0;
if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
/*