diff --git a/src/core/windows/util.c b/src/core/windows/util.c index a342ff1..5e0e919 100644 --- a/src/core/windows/util.c +++ b/src/core/windows/util.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "winversc.h" #include @@ -219,10 +220,10 @@ LIB3270_EXPORT const char * lib3270_win32_local_charset(void) { #define SECS_TO_100NS 10000000ULL /* 10^7 */ LIB3270_EXPORT char * lib3270_get_installation_path() { - char lpFilename[MAX_PATH]; + char lpFilename[MAX_PATH+1]; memset(lpFilename,0,sizeof(lpFilename)); - DWORD szPath = GetModuleFileName(hModule,lpFilename,sizeof(lpFilename)); + DWORD szPath = GetModuleFileName(hModule,lpFilename,MAX_PATH); lpFilename[szPath] = 0; char *ptr = strrchr(lpFilename,'\\'); -- libgit2 0.21.2