Commit 62a1410a authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Fix source/destination confusion in vsscanf.

parent 0bdd879f
......@@ -1178,19 +1178,19 @@ static int NTDLL_vsscanf( const char *str, const char *format, __ms_va_list ap)
else goto widecharacter;
character:
{ /* read single character into char */
char *str = suppress ? NULL : va_arg( ap, char * );
char *pstr = str;
char *sptr = suppress ? NULL : va_arg( ap, char * );
char *sptr_beg = sptr;
unsigned size = UINT_MAX;
if (width == -1) width = 1;
while (width && nch != '\0')
{
if (!suppress)
{
*str++ = nch;
*sptr++ = nch;
if(size) size--;
else
{
*pstr = 0;
*sptr_beg = 0;
return rd;
}
}
......@@ -1202,19 +1202,19 @@ static int NTDLL_vsscanf( const char *str, const char *format, __ms_va_list ap)
break;
widecharacter:
{ /* read single character into a WCHAR */
WCHAR *str = suppress ? NULL : va_arg( ap, WCHAR * );
WCHAR *pstr = str;
WCHAR *sptr = suppress ? NULL : va_arg( ap, WCHAR * );
WCHAR *sptr_beg = sptr;
unsigned size = UINT_MAX;
if (width == -1) width = 1;
while (width && nch != '\0')
{
if (!suppress)
{
*str++ = nch;
*sptr++ = nch;
if (size) size--;
else
{
*pstr = 0;
*sptr_beg = 0;
return rd;
}
}
......@@ -1248,10 +1248,10 @@ static int NTDLL_vsscanf( const char *str, const char *format, __ms_va_list ap)
break;
case '[':
{
char *str = suppress ? NULL : va_arg( ap, char * );
char *sptr = str;
char *sptr = suppress ? NULL : va_arg( ap, char * );
char *sptr_beg = sptr;
RTL_BITMAP bitMask;
ULONG Mask[8];
ULONG Mask[8] = { 0 };
BOOLEAN invert = FALSE; /* Set if we are NOT to find the chars */
unsigned size = UINT_MAX;
......@@ -1312,7 +1312,7 @@ static int NTDLL_vsscanf( const char *str, const char *format, __ms_va_list ap)
if(size > 1) size--;
else
{
*str = 0;
if (!suppress) *sptr_beg = 0;
return rd;
}
}
......
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