Skip to content

Commit

Permalink
Handle failure to convert WindowTitle preference to UTF8
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-cellier-aka-nice committed Dec 29, 2018
1 parent 7c5fe91 commit 19ebd67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion platforms/win32/vm/sqWin32Prefs.c
Expand Up @@ -212,7 +212,10 @@ void LoadPreferences()
TCHAR windowTitleT[MAX_PATH];
GetPrivateProfileString(U_GLOBAL, TEXT("WindowTitle"),
TEXT(""), windowTitleT, MAX_PATH, squeakIniName);
WideCharToMultiByte(CP_UTF8, 0, windowTitleT, -1, windowTitle, MAX_PATH, NULL, NULL);
if (WideCharToMultiByte(CP_UTF8, 0, windowTitleT, -1, windowTitle, MAX_PATH, NULL, NULL) == 0) {
printLastError(TEXT("Failed to convert WindowTitle preference to UTF-8"));
windowTitle[0] = 0;
};
}
#else
GetPrivateProfileString(U_GLOBAL, TEXT("WindowTitle"),
Expand Down

0 comments on commit 19ebd67

Please sign in to comment.