Commit 0aefd857 authored by Jon Griffiths's avatar Jon Griffiths Committed by Alexandre Julliard

vsnprintfW: %% should output a literal % sign.

parent d7eea364
......@@ -160,7 +160,7 @@ long int strtolW( const WCHAR *nptr, WCHAR **endptr, int base )
noconv:
/* We must handle a special case here: the base is 0 or 16 and the
first two characters are '0' and 'x', but the rest are no
first two characters are '0' and 'x', but the rest are not
hexadecimal digits. This is no error case. We return 0 and
ENDPTR points to the `x`. */
if (endptr != NULL)
......@@ -272,7 +272,7 @@ unsigned long int strtoulW( const WCHAR *nptr, WCHAR **endptr, int base )
noconv:
/* We must handle a special case here: the base is 0 or 16 and the
first two characters are '0' and 'x', but the rest are no
first two characters are '0' and 'x', but the rest are not
hexadecimal digits. This is no error case. We return 0 and
ENDPTR points to the `x`. */
if (endptr != NULL)
......@@ -305,6 +305,15 @@ int vsnprintfW(WCHAR *str, size_t len, const WCHAR *format, va_list valist)
}
if (*iter == '%')
{
if (iter[1] == '%')
{
if (written++ >= len)
return -1;
*str++ = '%'; /* "%%"->'%' */
iter += 2;
continue;
}
fmta = fmtbufa;
*fmta++ = *iter++;
while (*iter == '0' ||
......
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