From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125299 invoked by alias); 18 Dec 2019 19:56:53 -0000 Mailing-List: contact newlib-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-cvs-owner@sourceware.org Received: (qmail 125251 invoked by uid 9078); 18 Dec 2019 19:56:53 -0000 Date: Wed, 18 Dec 2019 19:56:00 -0000 Message-ID: <20191218195653.125249.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Fix fcvt to only show 'ndigit' past decimal X-Act-Checkin: newlib-cygwin X-Git-Author: Keith Packard X-Git-Refname: refs/heads/master X-Git-Oldrev: fe512b2b12a2cea8393d14f038dc3914b1bf3f60 X-Git-Newrev: abcc586ffec05a7779f8474119407d050392ee18 X-SW-Source: 2019-q4/txt/msg00028.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=abcc586ffec05a7779f8474119407d050392ee18 commit abcc586ffec05a7779f8474119407d050392ee18 Author: Keith Packard Date: Wed Dec 18 08:49:05 2019 -0800 Fix fcvt to only show 'ndigit' past decimal Even if the number is really small and this means showing *no* digits. This makes newlib match glibc, and the fcvt posix man page. Signed-off-by: Keith Packard Diff: --- newlib/libc/stdlib/ecvtbuf.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/newlib/libc/stdlib/ecvtbuf.c b/newlib/libc/stdlib/ecvtbuf.c index e3d7b55..12e8c9a 100644 --- a/newlib/libc/stdlib/ecvtbuf.c +++ b/newlib/libc/stdlib/ecvtbuf.c @@ -235,14 +235,7 @@ fcvtbuf (double invalue, save = fcvt_buf; - if (invalue < 1.0 && invalue > -1.0) - { - p = _dtoa_r (reent, invalue, 2, ndigit, decpt, sign, &end); - } - else - { - p = _dtoa_r (reent, invalue, 3, ndigit, decpt, sign, &end); - } + p = _dtoa_r (reent, invalue, 3, ndigit, decpt, sign, &end); /* Now copy */