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@23913 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2009-12-09 19:04:02 +00:00
parent 9dc1c1a876
commit c3a908f04b

View file

@ -57,12 +57,12 @@ static int unlock_volume(HANDLE hDisk)
void sansa_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);