diff options
| author | griffin <briang42@easystreet.net> | 2023-04-26 03:41:57 (GMT) |
|---|---|---|
| committer | griffin <briang42@easystreet.net> | 2023-04-26 03:41:57 (GMT) |
| commit | 3aaf8c054455ae5ad096a31922d26477397c8ed7 (patch) | |
| tree | da3b4149db099f21abca6f4443b7a054dc2a3f54 /unix/tclUnixInit.c | |
| parent | da6df4addedb2a495440a76f50733ff7b968cffc (diff) | |
| parent | 025b74f7c7add01c5ca6654b03c29241c0845def (diff) | |
| download | tcl-3aaf8c054455ae5ad096a31922d26477397c8ed7.zip tcl-3aaf8c054455ae5ad096a31922d26477397c8ed7.tar.gz tcl-3aaf8c054455ae5ad096a31922d26477397c8ed7.tar.bz2 | |
merge trunk, address some 32-bit issues.
Diffstat (limited to 'unix/tclUnixInit.c')
| -rw-r--r-- | unix/tclUnixInit.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 9d1c192..1aecbd8 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -544,9 +544,17 @@ TclpInitLibraryPath( Tcl_DStringFree(&buffer); *encodingPtr = Tcl_GetEncoding(NULL, NULL); - str = Tcl_GetStringFromObj(pathPtr, lengthPtr); - *valuePtr = (char *)Tcl_Alloc(*lengthPtr + 1); - memcpy(*valuePtr, str, *lengthPtr + 1); + + /* + * Note lengthPtr is (TCL_HASH_TYPE *) which is unsigned so cannot + * pass directly to Tcl_GetStringFromObj. + * TODO - why is the type TCL_HASH_TYPE anyways? + */ + Tcl_Size length; + str = Tcl_GetStringFromObj(pathPtr, &length); + *lengthPtr = length; + *valuePtr = (char *)Tcl_Alloc(length + 1); + memcpy(*valuePtr, str, length + 1); Tcl_DecrRefCount(pathPtr); } |
