From 5fe5d0aa874341cc015b0b71f5b5a6d9f3de8e7d Mon Sep 17 00:00:00 2001 From: Keith Marshall Date: Tue, 1 Nov 2016 19:45:15 +0000 Subject: [PATCH] Fix another printf() hex-float formatting bug. --- mingwrt/ChangeLog | 8 ++++++++ mingwrt/mingwex/stdio/pformat.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index 0526d23..1529dcf 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,3 +1,11 @@ +2016-11-01 Keith Marshall + + Fix another printf() hex-float formatting bug. + + * mingwex/stdio/pformat.c (__pformat_emit_xfloat) + [stream->flags & PFORMAT_ZEROFILL]: Ignore this; it should be... + [(stream->flags & PFORMAT_JUSTIFY) == PFORMAT_ZEROFILL]: ...thus. + 2016-10-30 Keith Marshall Work around MSDN inconsistencies in _finddata_t naming. diff --git a/mingwrt/mingwex/stdio/pformat.c b/mingwrt/mingwex/stdio/pformat.c index d5c024f..82b10a3 100644 --- a/mingwrt/mingwex/stdio/pformat.c +++ b/mingwrt/mingwex/stdio/pformat.c @@ -1654,7 +1654,8 @@ void __pformat_emit_xfloat( __pformat_fpreg_t value, __pformat_t *stream ) /* If the `0' flag is in effect... * Zero padding, to fill out the field, goes here... */ - if( (stream->width > 0) && (stream->flags & PFORMAT_ZEROFILL) ) + if( (stream->width > 0) + && ((stream->flags & PFORMAT_JUSTIFY) == PFORMAT_ZEROFILL) ) while( stream->width-- > 0 ) __pformat_putc( '0', stream ); -- 2.11.0