diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-03-30 15:19:44 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-03-30 15:19:44 (GMT) |
commit | 191fecdc87592dfea94718bc716551c72f072c33 (patch) | |
tree | 4aa12b60fc6ad7ca4c19658d774dee4326ad165b /generic/tclCompCmdsSZ.c | |
parent | 784535a35c779f46886fe9a880b706c979efdd77 (diff) | |
download | tcl-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.c | 6 |
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); |