summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tkSelect.c6
-rw-r--r--generic/tkTextDisp.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/generic/tkSelect.c b/generic/tkSelect.c
index 73e41d8..dccb49f 100644
--- a/generic/tkSelect.c
+++ b/generic/tkSelect.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkSelect.c,v 1.13.2.1 2005/11/22 11:32:37 dkf Exp $
+ * RCS: @(#) $Id: tkSelect.c,v 1.13.2.2 2011/01/25 08:49:59 nijtmans Exp $
*/
#include "tkInt.h"
@@ -917,7 +917,7 @@ Tk_SelectionObjCmd(clientData, interp, objc, objv)
cmdInfoPtr->byteOffset = 0;
cmdInfoPtr->buffer[0] = '\0';
cmdInfoPtr->cmdLength = cmdLength;
- strcpy(cmdInfoPtr->command, string);
+ memcpy(cmdInfoPtr->command, string, cmdLength + 1);
Tk_CreateSelHandler(tkwin, selection, target, HandleTclCommand,
(ClientData) cmdInfoPtr, format);
}
@@ -1016,7 +1016,7 @@ Tk_SelectionObjCmd(clientData, interp, objc, objv)
lostPtr = (LostCommand *) ckalloc((unsigned) (sizeof(LostCommand)
-3 + cmdLength));
lostPtr->interp = interp;
- strcpy(lostPtr->command, script);
+ memcpy(lostPtr->command, script, cmdLength + 1);
Tk_OwnSelection(tkwin, selection, LostSelection,
(ClientData) lostPtr);
return TCL_OK;
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 48897bd..e16bace 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkTextDisp.c,v 1.14.2.5 2007/04/29 02:24:02 das Exp $
+ * RCS: @(#) $Id: tkTextDisp.c,v 1.14.2.6 2011/01/25 08:49:59 nijtmans Exp $
*/
#include "tkPort.h"
@@ -4586,7 +4586,7 @@ TkTextCharLayoutProc(textPtr, indexPtr, segPtr, byteOffset, maxX, maxBytes,
(sizeof(CharInfo) - 3 + bytesThatFit));
chunkPtr->clientData = (ClientData) ciPtr;
ciPtr->numBytes = bytesThatFit;
- strncpy(ciPtr->chars, p, (size_t) bytesThatFit);
+ memcpy(ciPtr->chars, p, (size_t) bytesThatFit);
if (p[bytesThatFit - 1] == '\n') {
ciPtr->numBytes--;
}