OSDN Git Service

Fix another printf() hex-float formatting bug. legacy
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Tue, 1 Nov 2016 19:45:15 +0000 (19:45 +0000)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Tue, 1 Nov 2016 19:45:15 +0000 (19:45 +0000)
mingwrt/ChangeLog
mingwrt/mingwex/stdio/pformat.c

index 0526d23..1529dcf 100644 (file)
@@ -1,3 +1,11 @@
+2016-11-01  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       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  <keithmarshall@users.sourceforge.net>
 
        Work around MSDN inconsistencies in _finddata_t naming.
index d5c024f..82b10a3 100644 (file)
@@ -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 );