summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmdsSZ.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-30 15:19:44 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-30 15:19:44 (GMT)
commit191fecdc87592dfea94718bc716551c72f072c33 (patch)
tree4aa12b60fc6ad7ca4c19658d774dee4326ad165b /generic/tclCompCmdsSZ.c
parent784535a35c779f46886fe9a880b706c979efdd77 (diff)
downloadtcl-191fecdc87592dfea94718bc716551c72f072c33.zip
tcl-191fecdc87592dfea94718bc716551c72f072c33.tar.gz
tcl-191fecdc87592dfea94718bc716551c72f072c33.tar.bz2
Fix [0cb3554903]: macOS 13 SDK deprecates sprintf(). But better not use it on other platforms either.
Diffstat (limited to 'generic/tclCompCmdsSZ.c')
-rw-r--r--generic/tclCompCmdsSZ.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index db01dcd..5c2a0b6 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -837,7 +837,7 @@ TclCompileStringLenCmd(
char buf[TCL_INTEGER_SPACE];
int len = Tcl_GetCharLength(objPtr);
- len = sprintf(buf, "%d", len);
+ len = snprintf(buf, sizeof(buf), "%d", len);
PushLiteral(envPtr, buf, len);
} else {
SetLineInformation(1);
@@ -3073,7 +3073,7 @@ IssueTryClausesInstructions(
for (i=0 ; i<numHandlers ; i++) {
noError[i] = -1;
- sprintf(buf, "%d", matchCodes[i]);
+ snprintf(buf, sizeof(buf), "%d", matchCodes[i]);
OP( DUP);
PushLiteral(envPtr, buf, strlen(buf));
OP( EQ);
@@ -3285,7 +3285,7 @@ IssueTryClausesFinallyInstructions(
int noTrapError, trapError;
const char *p;
- sprintf(buf, "%d", matchCodes[i]);
+ snprintf(buf, sizeof(buf), "%d", matchCodes[i]);
OP( DUP);
PushLiteral(envPtr, buf, strlen(buf));
OP( EQ);