Always format error message using ANSI functions to get rid of type-punning when building with rbutil.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22759 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2009-09-20 17:03:58 +00:00
parent 8163ddeb7e
commit 8b32a2d473

View file

@ -56,12 +56,12 @@ static int unlock_volume(HANDLE hDisk)
void print_error(char* msg)
{
char* pMsgBuf;
LPSTR pMsgBuf = NULL;
printf(msg);
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&pMsgBuf,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), pMsgBuf,
0, NULL);
printf(pMsgBuf);
LocalFree(pMsgBuf);