Commit 34645c18f6ae0700fa3f20cd193ed1be5c70c31e
1 parent
29ce4539
Exists in
develop
Fixing warning.
Showing
1 changed file
with
3 additions
and
2 deletions
Show diff stats
src/core/windows/util.c
... | ... | @@ -33,6 +33,7 @@ |
33 | 33 | #include <windows.h> |
34 | 34 | #include <lmcons.h> |
35 | 35 | #include <internals.h> |
36 | +#include <io.h> | |
36 | 37 | |
37 | 38 | #include "winversc.h" |
38 | 39 | #include <ws2tcpip.h> |
... | ... | @@ -219,10 +220,10 @@ LIB3270_EXPORT const char * lib3270_win32_local_charset(void) { |
219 | 220 | #define SECS_TO_100NS 10000000ULL /* 10^7 */ |
220 | 221 | |
221 | 222 | LIB3270_EXPORT char * lib3270_get_installation_path() { |
222 | - char lpFilename[MAX_PATH]; | |
223 | + char lpFilename[MAX_PATH+1]; | |
223 | 224 | |
224 | 225 | memset(lpFilename,0,sizeof(lpFilename)); |
225 | - DWORD szPath = GetModuleFileName(hModule,lpFilename,sizeof(lpFilename)); | |
226 | + DWORD szPath = GetModuleFileName(hModule,lpFilename,MAX_PATH); | |
226 | 227 | lpFilename[szPath] = 0; |
227 | 228 | |
228 | 229 | char *ptr = strrchr(lpFilename,'\\'); | ... | ... |