view src/mingw-w64-3-fix-g-format.patch @ 4066:0962acdde3be

builld: allow out of source build * Makefile.in: add TOP_BUILD_DIR var and use TOP_DIR=srcdir, TOP_BUILD_DIR=builddir, modify paths to use TOP_DIR where needed * binary-dist-rules.mk: use TOP_DIR and TOP_BUILD_DIR where needed * makeinst-script.sh: use script path to determine TOPDIR, use TOPDIR where needed * src/default-octave.mk: install octave-version to builddir * src/stable-octave.mk: install octave-version to builddir * src/octave.mk: install octave-version to builddir * tools/set-mxe-env.sh.in: update fir builddir and srcdir use
author John Donoghue
date Wed, 23 Dec 2015 08:11:04 -0500
parents d7b2bb282421
children
line wrap: on
line source

From: John Donoghue <john.david.donoghue@gmail.com>
Date: Mon, 6 Apr 2015 09:29:43 -0400
Subject: [PATCH] Fix printf("%g") width format out by one in some instances
 (Bug 362)

* mingw-w64-crt\stdio\mingw_pformat.c
  (__pformat_emit_float): change width > len => width >= len

diff -ur mingw-w64-v3.3.0.orig/mingw-w64-crt/stdio/mingw_pformat.c mingw-w64-v3.3.0/mingw-w64-crt/stdio/mingw_pformat.c
--- mingw-w64-v3.3.0.orig/mingw-w64-crt/stdio/mingw_pformat.c	2015-04-06 10:12:45.486721000 -0400
+++ mingw-w64-v3.3.0/mingw-w64-crt/stdio/mingw_pformat.c	2015-04-06 10:14:26.200702676 -0400
@@ -1055,7 +1055,7 @@
      * reserve space in the output field, for the required number of
      * decimal digits to be placed before the decimal point...
      */
-    if( stream->width > len )
+    if( stream->width >= len )
       /*
        * adjusting as appropriate, when width is sufficient...
        */