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 /unix/tclUnixPipe.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 'unix/tclUnixPipe.c')
| -rw-r--r-- | unix/tclUnixPipe.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c index d5cb765..9d27632 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.c @@ -475,7 +475,7 @@ TclpCreateProcess( || (!joinThisError && !SetupStdFile(errorFile, TCL_STDERR)) || (joinThisError && ((dup2(1,2) == -1) || (fcntl(2, F_SETFD, 0) != 0)))) { - sprintf(errSpace, + snprintf(errSpace, sizeof(errSpace), "%dforked process couldn't set up input/output", errno); len = strlen(errSpace); if (len != (size_t) write(fd, errSpace, len)) { @@ -490,7 +490,7 @@ TclpCreateProcess( RestoreSignals(); execvp(newArgv[0], newArgv); /* INTL: Native. */ - sprintf(errSpace, "%dcouldn't execute \"%.150s\"", errno, argv[0]); + snprintf(errSpace, sizeof(errSpace), "%dcouldn't execute \"%.150s\"", errno, argv[0]); len = strlen(errSpace); if (len != (size_t) write(fd, errSpace, len)) { Tcl_Panic("TclpCreateProcess: unable to write to errPipeOut"); @@ -782,7 +782,7 @@ TclpCreateCommandChannel( * natural to use "pipe%d". */ - sprintf(channelName, "file%d", channelId); + snprintf(channelName, sizeof(channelName), "file%d", channelId); statePtr->channel = Tcl_CreateChannel(&pipeChannelType, channelName, statePtr, mode); return statePtr->channel; |
