[misc] fix a warning in msapi_utf8.h

Also set the AppStore default codepage to UTF-8
This commit is contained in:
Pete Batard 2021-03-25 19:27:27 +00:00
parent bb291df342
commit 1f4a2aaf30
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
3 changed files with 16 additions and 7 deletions

View file

@ -578,6 +578,10 @@ static __inline DWORD GetCurrentDirectoryU(DWORD nBufferLength, char* lpBuffer)
DWORD i, ret = 0, err = ERROR_INVALID_DATA;
// coverity[returned_null]
walloc(lpBuffer, nBufferLength);
if (wlpBuffer == NULL) {
SetLastError(ERROR_OUTOFMEMORY);
return 0;
}
ret = GetModuleFileNameW(NULL, wlpBuffer, nBufferLength);
err = GetLastError();
if (ret > 0) {