summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixPipe.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-30 22:02:55 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-30 22:02:55 (GMT)
commitdc5930bc812a27e31bf8a0aa2fcf564ed7306a26 (patch)
treecfdd8df6ed6eeb844e46e1d630692a8a6137fbb9 /unix/tclUnixPipe.c
parentf8b9e919c954be237c906a708530111607f88081 (diff)
parent186145578675341deb63fd53e6080896695c3574 (diff)
downloadtcl-dc5930bc812a27e31bf8a0aa2fcf564ed7306a26.zip
tcl-dc5930bc812a27e31bf8a0aa2fcf564ed7306a26.tar.gz
tcl-dc5930bc812a27e31bf8a0aa2fcf564ed7306a26.tar.bz2
Merge 8.6
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 c53360a..c1fd36f 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;