Commit 5ddca3dc authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

shlwapi: Fix wnsprintfA/wvnsprintfA %C conversion.

parent 7cc21d03
...@@ -254,8 +254,11 @@ static UINT WPRINTF_GetLen( WPRINTF_FORMAT *format, WPRINTF_DATA *arg, ...@@ -254,8 +254,11 @@ static UINT WPRINTF_GetLen( WPRINTF_FORMAT *format, WPRINTF_DATA *arg,
switch(format->type) switch(format->type)
{ {
case WPR_CHAR: case WPR_CHAR:
case WPR_WCHAR:
return (format->precision = 1); return (format->precision = 1);
case WPR_WCHAR:
if (dst_is_wide) len = 1;
else len = WideCharToMultiByte( CP_ACP, 0, &arg->wchar_view, 1, NULL, 0, NULL, NULL );
return (format->precision = len);
case WPR_STRING: case WPR_STRING:
if (!arg->lpcstr_view) arg->lpcstr_view = null_stringA; if (!arg->lpcstr_view) arg->lpcstr_view = null_stringA;
if (dst_is_wide) if (dst_is_wide)
...@@ -397,7 +400,14 @@ INT WINAPI wvnsprintfA( LPSTR buffer, INT maxlen, LPCSTR spec, __ms_va_list args ...@@ -397,7 +400,14 @@ INT WINAPI wvnsprintfA( LPSTR buffer, INT maxlen, LPCSTR spec, __ms_va_list args
switch(format.type) switch(format.type)
{ {
case WPR_WCHAR: case WPR_WCHAR:
*p++ = argData.wchar_view; {
CHAR mb[5];
if (WideCharToMultiByte( CP_ACP, 0, &argData.wchar_view, 1, mb, sizeof(mb), NULL, NULL ))
{
memcpy( p, mb, len );
p += len;
}
}
break; break;
case WPR_CHAR: case WPR_CHAR:
*p++ = argData.char_view; *p++ = argData.char_view;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment