summaryrefslogtreecommitdiffstats
path: root/generic/tclFileName.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-08-23 18:20:50 (GMT)
committerhobbs <hobbs>2001-08-23 18:20:50 (GMT)
commitd47a11a41d9e4135a144e498ff673ff43c5057d9 (patch)
treee95bc01518484622ad51ae701d0f9022d39b0a8e /generic/tclFileName.c
parentf319c32167c2c52995fe53b438ef4bc34e9a4914 (diff)
downloadtcl-d47a11a41d9e4135a144e498ff673ff43c5057d9.zip
tcl-d47a11a41d9e4135a144e498ff673ff43c5057d9.tar.gz
tcl-d47a11a41d9e4135a144e498ff673ff43c5057d9.tar.bz2
corrected minor compiler warnings
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r--generic/tclFileName.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index d9d7b62..e4c484d 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclFileName.c,v 1.17 2001/08/23 17:37:07 vincentdarley Exp $
+ * RCS: @(#) $Id: tclFileName.c,v 1.18 2001/08/23 18:20:50 hobbs Exp $
*/
#include "tclInt.h"
@@ -538,9 +538,9 @@ Tcl_SplitPath(path, argcPtr, argvPtr)
* of pointers to path elements. */
{
Tcl_Obj *resultPtr = NULL; /* Needed only to prevent gcc warnings. */
- Tcl_Obj *tmpPtr;
- int i, size;
- char *p;
+ Tcl_Obj *tmpPtr, *eltPtr;
+ int i, size, len;
+ char *p, *str;
/*
* Perform the splitting, using objectified, vfs-aware code.
@@ -555,11 +555,8 @@ Tcl_SplitPath(path, argcPtr, argvPtr)
size = 1;
for (i = 0; i < *argcPtr; i++) {
- int len;
- Tcl_Obj *elt;
-
- Tcl_ListObjIndex(NULL, resultPtr, i, &elt);
- Tcl_GetStringFromObj(elt, &len);
+ Tcl_ListObjIndex(NULL, resultPtr, i, &eltPtr);
+ Tcl_GetStringFromObj(eltPtr, &len);
size += len + 1;
}
@@ -578,13 +575,9 @@ Tcl_SplitPath(path, argcPtr, argvPtr)
p = (char *) &(*argvPtr)[(*argcPtr) + 1];
for (i = 0; i < *argcPtr; i++) {
- int len;
- Tcl_Obj *elt;
- char *str;
-
- Tcl_ListObjIndex(NULL, resultPtr, i, &elt);
- str = Tcl_GetStringFromObj(elt, &len);
- strncpy(p, str, len+1);
+ Tcl_ListObjIndex(NULL, resultPtr, i, &eltPtr);
+ str = Tcl_GetStringFromObj(eltPtr, &len);
+ memcpy((VOID *) p, (VOID *) str, (size_t) len+1);
p += len+1;
}
@@ -1048,7 +1041,7 @@ TclpNativeJoinPath(prefix, joining)
* slashes.
*/
- Tcl_SetObjLength(prefix, length + strlen(p));
+ Tcl_SetObjLength(prefix, length + (int) strlen(p));
dest = Tcl_GetString(prefix) + length;
for (; *p != '\0'; p++) {
@@ -1087,7 +1080,7 @@ TclpNativeJoinPath(prefix, joining)
* trailing slashes.
*/
- Tcl_SetObjLength(prefix, length + strlen(p));
+ Tcl_SetObjLength(prefix, length + (int) strlen(p));
dest = Tcl_GetString(prefix) + length;
for (; *p != '\0'; p++) {
if ((*p == '/') || (*p == '\\')) {