diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-02-23 14:01:41 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-02-23 14:01:41 (GMT) |
commit | 9dd933ddbd77c005974356951f153c9f6de1236e (patch) | |
tree | 6d3ff5026d1d5699bb36291cf8be7e15589acab1 /win | |
parent | 5c17bbd9794f9f2fca6b4aa33ac71ef24e4515d1 (diff) | |
parent | 5c8ce61f7963bdd41e0d7c9d18a7b4e5f918eb35 (diff) | |
download | tcl-9dd933ddbd77c005974356951f153c9f6de1236e.zip tcl-9dd933ddbd77c005974356951f153c9f6de1236e.tar.gz tcl-9dd933ddbd77c005974356951f153c9f6de1236e.tar.bz2 |
Merge 8.7
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinFile.c | 2 | ||||
-rw-r--r-- | win/tclWinInit.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c index f89b522..1e0aca7 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -885,7 +885,7 @@ TclpFindExecutable( Tcl_SetPanicProc(tclWinDebugPanic); } - GetModuleFileNameW(NULL, wName, MAX_PATH); + GetModuleFileNameW(NULL, wName, sizeof(wName)/sizeof(WCHAR)); WideCharToMultiByte(CP_UTF8, 0, wName, -1, name, sizeof(name), NULL, NULL); TclWinNoBackslash(name); TclSetObjNameOfExecutable(Tcl_NewStringObj(name, -1), NULL); diff --git a/win/tclWinInit.c b/win/tclWinInit.c index a50d9eb..2830a85 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -334,8 +334,8 @@ InitializeDefaultLibraryDir( char name[(MAX_PATH + LIBRARY_SIZE) * 3]; char *end, *p; - GetModuleFileNameW(hModule, wName, MAX_PATH); - WideCharToMultiByte(CP_UTF8, 0, wName, -1, name, MAX_PATH * 3, NULL, NULL); + GetModuleFileNameW(hModule, wName, sizeof(wName)/sizeof(WCHAR)); + WideCharToMultiByte(CP_UTF8, 0, wName, -1, name, sizeof(name), NULL, NULL); end = strrchr(name, '\\'); *end = '\0'; @@ -382,8 +382,8 @@ InitializeSourceLibraryDir( char name[(MAX_PATH + LIBRARY_SIZE) * 3]; char *end, *p; - GetModuleFileNameW(hModule, wName, MAX_PATH); - WideCharToMultiByte(CP_UTF8, 0, wName, -1, name, MAX_PATH * 3, NULL, NULL); + GetModuleFileNameW(hModule, wName, sizeof(wName)/sizeof(WCHAR)); + WideCharToMultiByte(CP_UTF8, 0, wName, -1, name, sizeof(name), NULL, NULL); end = strrchr(name, '\\'); *end = '\0'; |