diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2010-10-01 12:52:48 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2010-10-01 12:52:48 (GMT) |
commit | 0ee4b2f57c83341c5896b9abe552e28874292a12 (patch) | |
tree | 9bc2b696d5f1dd703e2c0f71eec0ffb13ca67447 /generic/tclResolve.c | |
parent | c240909716db63ba2036f34e975de5905b2871dd (diff) | |
download | tcl-0ee4b2f57c83341c5896b9abe552e28874292a12.zip tcl-0ee4b2f57c83341c5896b9abe552e28874292a12.tar.gz tcl-0ee4b2f57c83341c5896b9abe552e28874292a12.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/tclResolve.c')
-rw-r--r-- | generic/tclResolve.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/generic/tclResolve.c b/generic/tclResolve.c index 7a86427..109948e 100644 --- a/generic/tclResolve.c +++ b/generic/tclResolve.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: tclResolve.c,v 1.12 2010/01/29 16:17:20 nijtmans Exp $ + * RCS: @(#) $Id: tclResolve.c,v 1.13 2010/10/01 12:52:50 dkf Exp $ */ #include "tclInt.h" @@ -67,6 +67,7 @@ Tcl_AddInterpResolvers( { Interp *iPtr = (Interp *) interp; ResolverScheme *resPtr; + unsigned len; /* * Since we're adding a new name resolution scheme, we must force all code @@ -103,8 +104,9 @@ Tcl_AddInterpResolvers( */ resPtr = (ResolverScheme *) ckalloc(sizeof(ResolverScheme)); - resPtr->name = (char *) ckalloc((unsigned)(strlen(name) + 1)); - strcpy(resPtr->name, name); + len = strlen(name) + 1; + resPtr->name = (char *) ckalloc(len); + memcpy(resPtr->name, name, len); resPtr->cmdResProc = cmdProc; resPtr->varResProc = varProc; resPtr->compiledVarResProc = compiledVarProc; |