mirror of
https://github.com/reactos/wine.git
synced 2025-02-07 20:57:39 +00:00
The behavior for wsprintfA is different that for wsprintf16 in how it
handles NULLs being passed as character parameters.
This commit is contained in:
parent
5ee3879ce0
commit
1e5777edf5
@ -312,6 +312,7 @@ static INT16 wvsnprintf16( LPSTR buffer, UINT16 maxlen, LPCSTR spec,
|
|||||||
case WPR_WCHAR: /* No Unicode in Win16 */
|
case WPR_WCHAR: /* No Unicode in Win16 */
|
||||||
case WPR_CHAR:
|
case WPR_CHAR:
|
||||||
*p= cur_arg.char_view;
|
*p= cur_arg.char_view;
|
||||||
|
/* wsprintf16 (unlike wsprintf) ignores null characters */
|
||||||
if (*p != '\0') p++;
|
if (*p != '\0') p++;
|
||||||
else if (format.width > 1) *p++ = ' ';
|
else if (format.width > 1) *p++ = ' ';
|
||||||
else len = 0;
|
else len = 0;
|
||||||
@ -400,16 +401,10 @@ INT WINAPI wvsnprintfA( LPSTR buffer, UINT maxlen, LPCSTR spec, va_list args )
|
|||||||
switch(format.type)
|
switch(format.type)
|
||||||
{
|
{
|
||||||
case WPR_WCHAR:
|
case WPR_WCHAR:
|
||||||
*p = argData.wchar_view;
|
*p++ = argData.wchar_view;
|
||||||
if (*p != '\0') p++;
|
|
||||||
else if (format.width > 1) *p++ = ' ';
|
|
||||||
else len = 0;
|
|
||||||
break;
|
break;
|
||||||
case WPR_CHAR:
|
case WPR_CHAR:
|
||||||
*p = argData.char_view;
|
*p++ = argData.char_view;
|
||||||
if (*p != '\0') p++;
|
|
||||||
else if (format.width > 1) *p++ = ' ';
|
|
||||||
else len = 0;
|
|
||||||
break;
|
break;
|
||||||
case WPR_STRING:
|
case WPR_STRING:
|
||||||
memcpy( p, argData.lpcstr_view, len );
|
memcpy( p, argData.lpcstr_view, len );
|
||||||
@ -501,16 +496,10 @@ INT WINAPI wvsnprintfW( LPWSTR buffer, UINT maxlen, LPCWSTR spec, va_list args )
|
|||||||
switch(format.type)
|
switch(format.type)
|
||||||
{
|
{
|
||||||
case WPR_WCHAR:
|
case WPR_WCHAR:
|
||||||
*p = argData.wchar_view;
|
*p++ = argData.wchar_view;
|
||||||
if (*p != '\0') p++;
|
|
||||||
else if (format.width > 1) *p++ = ' ';
|
|
||||||
else len = 0;
|
|
||||||
break;
|
break;
|
||||||
case WPR_CHAR:
|
case WPR_CHAR:
|
||||||
*p = argData.char_view;
|
*p++ = argData.char_view;
|
||||||
if (*p != '\0') p++;
|
|
||||||
else if (format.width > 1) *p++ = ' ';
|
|
||||||
else len = 0;
|
|
||||||
break;
|
break;
|
||||||
case WPR_STRING:
|
case WPR_STRING:
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user