mirror of
https://github.com/reactos/reactos.git
synced 2024-08-11 21:58:10 +00:00
[CRT]
In streamout() handle %%, negative fieldwidth and negative precision. svn path=/trunk/; revision=49514
This commit is contained in:
parent
49cee181ca
commit
2f7608101c
|
@ -97,7 +97,8 @@ format_float(
|
||||||
int num_digits, val32, base = 10;
|
int num_digits, val32, base = 10;
|
||||||
__int64 val64;
|
__int64 val64;
|
||||||
|
|
||||||
if (precision == -1) precision = 6;
|
if (precision < 0) precision = 6;
|
||||||
|
else if (precision > 512) precision = 512;
|
||||||
|
|
||||||
fpval = va_arg_ffp(*argptr, flags);
|
fpval = va_arg_ffp(*argptr, flags);
|
||||||
exponent = get_exp(fpval);
|
exponent = get_exp(fpval);
|
||||||
|
@ -302,7 +303,15 @@ streamout(FILE *stream, const TCHAR *format, va_list argptr)
|
||||||
/* Write the character to the stream */
|
/* Write the character to the stream */
|
||||||
if ((written = streamout_char(stream, chr)) == -1) return -1;
|
if ((written = streamout_char(stream, chr)) == -1) return -1;
|
||||||
written_all += written;
|
written_all += written;
|
||||||
/* Continue with next char */
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check for escaped % character */
|
||||||
|
if (*format == _T('%'))
|
||||||
|
{
|
||||||
|
/* Write % to the stream */
|
||||||
|
if ((written = streamout_char(stream, _T('%'))) == -1) return -1;
|
||||||
|
written_all += written;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,6 +332,11 @@ streamout(FILE *stream, const TCHAR *format, va_list argptr)
|
||||||
if (chr == _T('*'))
|
if (chr == _T('*'))
|
||||||
{
|
{
|
||||||
fieldwidth = va_arg(argptr, int);
|
fieldwidth = va_arg(argptr, int);
|
||||||
|
if (fieldwidth < 0)
|
||||||
|
{
|
||||||
|
flags |= FLAG_ALIGN_LEFT;
|
||||||
|
fieldwidth = -fieldwidth;
|
||||||
|
}
|
||||||
chr = *format++;
|
chr = *format++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue