summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixSend.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tkUnixSend.c')
-rw-r--r--unix/tkUnixSend.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c
index 03d124f..72b2b1e 100644
--- a/unix/tkUnixSend.c
+++ b/unix/tkUnixSend.c
@@ -476,7 +476,7 @@ RegAddName(
char id[30], *newProp;
int idLength, newBytes;
- sprintf(id, "%x ", (unsigned) commWindow);
+ snprintf(id, sizeof(id), "%x ", (unsigned) commWindow);
idLength = strlen(id);
newBytes = idLength + strlen(name) + 1;
newProp = (char *)ckalloc(regPtr->propLength + newBytes);
@@ -875,7 +875,7 @@ Tk_SetAppName(
Tcl_DStringSetLength(&dString, offset+TCL_INTEGER_SPACE);
actualName = Tcl_DStringValue(&dString);
}
- sprintf(Tcl_DStringValue(&dString) + offset, "%d", i);
+ snprintf(Tcl_DStringValue(&dString) + offset, TCL_INTEGER_SPACE, "%d", i);
}
w = RegFindName(regPtr, actualName);
if (w == None) {
@@ -1096,7 +1096,7 @@ Tk_SendObjCmd(
if (!async) {
char buffer[TCL_INTEGER_SPACE * 2];
- sprintf(buffer, "%x %d",
+ snprintf(buffer, sizeof(buffer), "%x %d",
(unsigned) Tk_WindowId(dispPtr->commTkwin),
localData.sendSerial);
Tcl_DStringAppend(&request, "\0-r ", 4);
@@ -1620,7 +1620,7 @@ SendEventProc(
if (result != TCL_OK) {
char buffer[TCL_INTEGER_SPACE];
- sprintf(buffer, "%d", result);
+ snprintf(buffer, sizeof(buffer), "%d", result);
Tcl_DStringAppend(&reply, "\0-c ", 4);
Tcl_DStringAppend(&reply, buffer, -1);
}
@@ -1796,7 +1796,7 @@ AppendErrorProc(
pcPtr = pcPtr->nextPtr) {
if ((pcPtr == pendingPtr) && (pcPtr->result == NULL)) {
pcPtr->result = (char *)ckalloc(strlen(pcPtr->target) + 50);
- sprintf(pcPtr->result, "no application named \"%s\"",
+ snprintf(pcPtr->result, strlen(pcPtr->target) + 50, "no application named \"%s\"",
pcPtr->target);
pcPtr->code = TCL_ERROR;
pcPtr->gotResponse = 1;