summaryrefslogtreecommitdiffstats
path: root/generic/tclNamesp.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-10-01 12:52:48 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-10-01 12:52:48 (GMT)
commit3dd93575aa3c2b6cdf2f544073076f285d3e23a9 (patch)
tree9bc2b696d5f1dd703e2c0f71eec0ffb13ca67447 /generic/tclNamesp.c
parent2a45ec67528094a5b6b09f49001fafad13b28cee (diff)
downloadtcl-3dd93575aa3c2b6cdf2f544073076f285d3e23a9.zip
tcl-3dd93575aa3c2b6cdf2f544073076f285d3e23a9.tar.gz
tcl-3dd93575aa3c2b6cdf2f544073076f285d3e23a9.tar.bz2
* generic/tclBasic.c, generic/tclClock.c, generic/tclEncoding.c,
* generic/tclEnv.c, generic/tclLoad.c, generic/tclNamesp.c, * generic/tclObj.c, generic/tclRegexp.c, generic/tclResolve.c, * generic/tclResult.c, generic/tclUtil.c, macosx/tclMacOSXFCmd.c: More purging of strcpy() from locations where we already know the length of the data being copied.
Diffstat (limited to 'generic/tclNamesp.c')
-rw-r--r--generic/tclNamesp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 6961fd5..2d1ce11 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -22,7 +22,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclNamesp.c,v 1.212 2010/08/30 14:02:10 msofer Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.213 2010/10/01 12:52:49 dkf Exp $
*/
#include "tclInt.h"
@@ -706,8 +706,9 @@ Tcl_CreateNamespace(
*/
nsPtr = (Namespace *) ckalloc(sizeof(Namespace));
- nsPtr->name = ckalloc((unsigned) (strlen(simpleName)+1));
- strcpy(nsPtr->name, simpleName);
+ nameLen = strlen(simpleName) + 1;
+ nsPtr->name = ckalloc((unsigned) nameLen);
+ memcpy(nsPtr->name, simpleName, nameLen);
nsPtr->fullName = NULL; /* Set below. */
nsPtr->clientData = clientData;
nsPtr->deleteProc = deleteProc;