all repos — mgba @ fd809b3b39cfb362eae63bffc03dc90f58b1ece7

mGBA Game Boy Advance Emulator

GBA: Fix Windows build
Jeffrey Pfau jeffrey@endrift.com
Sun, 05 Jul 2015 15:00:29 -0700
commit

fd809b3b39cfb362eae63bffc03dc90f58b1ece7

parent

38ec77b8038c826313f42149a8cb114dcabeed8e

1 files changed, 3 insertions(+), 2 deletions(-)

jump to
M src/gba/supervisor/config.csrc/gba/supervisor/config.c

@@ -134,14 +134,15 @@ getcwd(out, PATH_MAX);

strncat(out, PATH_SEP "portable.ini", PATH_MAX - strlen(out)); portable = VFileOpen(out, O_WRONLY | O_CREAT); #else + char out[MAX_PATH]; wchar_t wpath[MAX_PATH]; wchar_t wprojectName[MAX_PATH]; MultiByteToWideChar(CP_UTF8, 0, projectName, -1, wprojectName, MAX_PATH); HMODULE hModule = GetModuleHandleW(NULL); GetModuleFileNameW(hModule, wpath, MAX_PATH); PathRemoveFileSpecW(wpath); - WideCharToMultiByte(CP_UTF8, 0, wpath, -1, out, outLength, 0, 0); - StringCchCatA(out, outLength, "\\portable.ini"); + WideCharToMultiByte(CP_UTF8, 0, wpath, -1, out, MAX_PATH, 0, 0); + StringCchCatA(out, MAX_PATH, "\\portable.ini"); portable = VFileOpen(out, O_WRONLY | O_CREAT); #endif if (portable) {