From 8b32a2d473fff5e1e52a51ad71f0a149f1cc7cf6 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sun, 20 Sep 2009 17:03:58 +0000 Subject: 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 --- rbutil/ipodpatcher/ipodio-win32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rbutil/ipodpatcher/ipodio-win32.c b/rbutil/ipodpatcher/ipodio-win32.c index 5125c070f8..29391bfa4f 100644 --- a/rbutil/ipodpatcher/ipodio-win32.c +++ b/rbutil/ipodpatcher/ipodio-win32.c @@ -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); -- cgit v1.2.3