summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-12-26 16:31:27 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-12-26 16:31:27 (GMT)
commit4c97b25f81b1f2cbabe7f084e86e539bcbdbc21a (patch)
treea2e6357521552e0fc9f322e4290940254aece001 /generic/tclEncoding.c
parenta021f251e2b1ea8a73540c6984aa332cb798bf60 (diff)
downloadtcl-4c97b25f81b1f2cbabe7f084e86e539bcbdbc21a.zip
tcl-4c97b25f81b1f2cbabe7f084e86e539bcbdbc21a.tar.gz
tcl-4c97b25f81b1f2cbabe7f084e86e539bcbdbc21a.tar.bz2
Don't use TCL_SIZE_MODIFIER "u", since Tcl_Size can be negative
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 262dd01..2d1c983 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -1224,7 +1224,7 @@ Tcl_ExternalToUtfDString(
* Tcl_ExternalToUtfDStringEx --
*
* Convert a source buffer from the specified encoding into UTF-8.
- * The parameter flags controls the behavior, if any of the bytes in
+ * "flags" controls the behavior if any of the bytes in
* the source buffer are invalid or cannot be represented in utf-8.
* Possible flags values:
* target encoding. It should be composed by OR-ing the following:
@@ -1333,11 +1333,11 @@ Tcl_ExternalToUtfDStringEx(
/* Caller wants error message on failure */
if (result != TCL_OK && interp != NULL) {
char buf[TCL_INTEGER_SPACE];
- snprintf(buf, sizeof(buf), "%" TCL_SIZE_MODIFIER "u", nBytesProcessed);
+ snprintf(buf, sizeof(buf), "%" TCL_SIZE_MODIFIER "d", nBytesProcessed);
Tcl_SetObjResult(
interp,
Tcl_ObjPrintf("unexpected byte sequence starting at index %"
- TCL_SIZE_MODIFIER "u: '\\x%02X'",
+ TCL_SIZE_MODIFIER "d: '\\x%02X'",
nBytesProcessed,
UCHAR(srcStart[nBytesProcessed])));
Tcl_SetErrorCode(
@@ -1636,7 +1636,7 @@ Tcl_UtfToExternalDStringEx(
int ucs4;
char buf[TCL_INTEGER_SPACE];
Tcl_UtfToUniChar(&srcStart[nBytesProcessed], &ucs4);
- snprintf(buf, sizeof(buf), "%" TCL_SIZE_MODIFIER "u", nBytesProcessed);
+ snprintf(buf, sizeof(buf), "%" TCL_SIZE_MODIFIER "d", nBytesProcessed);
Tcl_SetObjResult(
interp,
Tcl_ObjPrintf(