summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixPipe.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-30 22:22:32 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-30 22:22:32 (GMT)
commitfeac96c8b3c738ef7cb8e3e89e076aa4f23f13b0 (patch)
tree196f438c5ba746829c249ad28e10c94a4a44ee0c /unix/tclUnixPipe.c
parent67ced520761d9c2dff0022dafbebdb996e20b551 (diff)
parented24f448c79bc5af4c0f6fd77826a6552271dd9c (diff)
downloadtcl-feac96c8b3c738ef7cb8e3e89e076aa4f23f13b0.zip
tcl-feac96c8b3c738ef7cb8e3e89e076aa4f23f13b0.tar.gz
tcl-feac96c8b3c738ef7cb8e3e89e076aa4f23f13b0.tar.bz2
Merge 8.7
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 0692df5..19127d2 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;