diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinFile.c | 2 | ||||
-rw-r--r-- | win/tclWinInit.c | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c index d582664..8df346f 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -852,7 +852,7 @@ TclpFindExecutable( * create this process. */ - if (GetModuleFileNameW(NULL, wName, MAX_PATH) == 0) { + if (GetModuleFileNameW(NULL, wName, sizeof(wName)/sizeof(WCHAR)) == 0) { GetModuleFileNameA(NULL, name, sizeof(name)); /* diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 6c34573..2abcd3e 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -342,11 +342,11 @@ InitializeDefaultLibraryDir( { HMODULE hModule = TclWinGetTclInstance(); WCHAR wName[MAX_PATH + LIBRARY_SIZE]; - char name[(MAX_PATH + LIBRARY_SIZE) * TCL_UTF_MAX]; + char name[(MAX_PATH + LIBRARY_SIZE) * 3]; char *end, *p; - if (GetModuleFileNameW(hModule, wName, MAX_PATH) == 0) { - GetModuleFileNameA(hModule, name, MAX_PATH); + if (GetModuleFileNameW(hModule, wName, sizeof(wName)/sizeof(WCHAR)) == 0) { + GetModuleFileNameA(hModule, name, sizeof(name)); } else { ToUtf(wName, name); } @@ -393,11 +393,11 @@ InitializeSourceLibraryDir( { HMODULE hModule = TclWinGetTclInstance(); WCHAR wName[MAX_PATH + LIBRARY_SIZE]; - char name[(MAX_PATH + LIBRARY_SIZE) * TCL_UTF_MAX]; + char name[(MAX_PATH + LIBRARY_SIZE) * 3]; char *end, *p; - if (GetModuleFileNameW(hModule, wName, MAX_PATH) == 0) { - GetModuleFileNameA(hModule, name, MAX_PATH); + if (GetModuleFileNameW(hModule, wName, sizeof(wName)/sizeof(WCHAR)) == 0) { + GetModuleFileNameA(hModule, name, sizeof(name)); } else { ToUtf(wName, name); } |