diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-11-16 10:55:40 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-11-16 10:55:40 (GMT) |
commit | 29606e4a7b43adb9f923fb5781d3b9a93d9ba1c8 (patch) | |
tree | 6cf185a0504de6ff8fa054121bf9d289cfbbc717 /unix/tclUnixInit.c | |
parent | ed830e98b74fe64225572a43a9b67e99c2b4d65c (diff) | |
download | tcl-29606e4a7b43adb9f923fb5781d3b9a93d9ba1c8.zip tcl-29606e4a7b43adb9f923fb5781d3b9a93d9ba1c8.tar.gz tcl-29606e4a7b43adb9f923fb5781d3b9a93d9ba1c8.tar.bz2 |
Use more "size_t" in stead of "int" internall. Also eliminate a lot of type-casts which are not necessary any more.
Diffstat (limited to 'unix/tclUnixInit.c')
-rw-r--r-- | unix/tclUnixInit.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 31177a3..1e35b92 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -453,7 +453,7 @@ TclpInitPlatform(void) void TclpInitLibraryPath( char **valuePtr, - int *lengthPtr, + size_t *lengthPtr, Tcl_Encoding *encodingPtr) { #define LIBRARY_SIZE 32 @@ -542,9 +542,10 @@ TclpInitLibraryPath( Tcl_DStringFree(&buffer); *encodingPtr = Tcl_GetEncoding(NULL, NULL); - str = TclGetStringFromObj(pathPtr, lengthPtr); - *valuePtr = ckalloc((*lengthPtr) + 1); - memcpy(*valuePtr, str, (size_t)(*lengthPtr)+1); + str = TclGetString(pathPtr); + *lengthPtr = pathPtr->length; + *valuePtr = ckalloc(*lengthPtr + 1); + memcpy(*valuePtr, str, *lengthPtr + 1); Tcl_DecrRefCount(pathPtr); } |