diff options
author | dgp <dgp@users.sourceforge.net> | 2022-03-08 17:12:28 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2022-03-08 17:12:28 (GMT) |
commit | 77d395c7f814d2a2d784c06b197ea84fc03ab213 (patch) | |
tree | e09193f6fcae8020652bddfb62c31909f5a93fc7 /generic | |
parent | 94033c98698f9311df88190fad45f190b4b829a8 (diff) | |
download | tcl-77d395c7f814d2a2d784c06b197ea84fc03ab213.zip tcl-77d395c7f814d2a2d784c06b197ea84fc03ab213.tar.gz tcl-77d395c7f814d2a2d784c06b197ea84fc03ab213.tar.bz2 |
Backport fix and test for typecasting bug in Tcl_GetUniChar().
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclStringObj.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index d1e709c..4afd12a 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -576,7 +576,7 @@ Tcl_GetUniChar( TclNumUtfChars(stringPtr->numChars, objPtr->bytes, objPtr->length); } if (stringPtr->numChars == objPtr->length) { - return (Tcl_UniChar) objPtr->bytes[index]; + return (unsigned char) objPtr->bytes[index]; } FillUnicodeRep(objPtr); stringPtr = GET_STRING(objPtr); @@ -632,7 +632,7 @@ TclGetUCS4( TclNumUtfChars(stringPtr->numChars, objPtr->bytes, objPtr->length); } if (stringPtr->numChars == objPtr->length) { - return (Tcl_UniChar) objPtr->bytes[index]; + return (unsigned char) objPtr->bytes[index]; } FillUnicodeRep(objPtr); stringPtr = GET_STRING(objPtr); |