summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixPipe.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-30 22:24:21 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-30 22:24:21 (GMT)
commitcef495763ed9a8373404b7e14f6b3fe8ab22ff1a (patch)
treeba24aa81061339388cb9a7b04606ff9b20914c36 /unix/tclUnixPipe.c
parent1ad604bcbe30411460ba6a66976b694768b50082 (diff)
parentfeac96c8b3c738ef7cb8e3e89e076aa4f23f13b0 (diff)
downloadtcl-cef495763ed9a8373404b7e14f6b3fe8ab22ff1a.zip
tcl-cef495763ed9a8373404b7e14f6b3fe8ab22ff1a.tar.gz
tcl-cef495763ed9a8373404b7e14f6b3fe8ab22ff1a.tar.bz2
Merge 9.0
Diffstat (limited to 'unix/tclUnixPipe.c')
-rw-r--r--unix/tclUnixPipe.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c
index a2fa5a4..b0cc16a 100644
--- a/unix/tclUnixPipe.c
+++ b/unix/tclUnixPipe.c
@@ -476,7 +476,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)) {
@@ -491,7 +491,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");
@@ -783,7 +783,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;