From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55941 invoked by alias); 13 Dec 2018 12:16:51 -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 55681 invoked by uid 9078); 13 Dec 2018 12:16:34 -0000 Date: Thu, 13 Dec 2018 12:16:00 -0000 Message-ID: <20181213121634.55679.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] nano-vfprintf_float.c: Fix check if negative for nans. X-Act-Checkin: newlib-cygwin X-Git-Author: Jon Beniston X-Git-Refname: refs/heads/master X-Git-Oldrev: df6915f029ac9acd2b479ea898388cbd7dda4974 X-Git-Newrev: b3692aed5e48b6107afba6aab21d03191dc80117 X-SW-Source: 2018-q4/txt/msg00041.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b3692aed5e48b6107afba6aab21d03191dc80117 commit b3692aed5e48b6107afba6aab21d03191dc80117 Author: Jon Beniston Date: Tue Dec 11 21:03:03 2018 +0000 nano-vfprintf_float.c: Fix check if negative for nans. Diff: --- newlib/libc/stdio/nano-vfprintf_float.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/newlib/libc/stdio/nano-vfprintf_float.c b/newlib/libc/stdio/nano-vfprintf_float.c index 071a09e..524f67a 100644 --- a/newlib/libc/stdio/nano-vfprintf_float.c +++ b/newlib/libc/stdio/nano-vfprintf_float.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -213,7 +214,7 @@ _printf_float (struct _reent *data, } if (isnan (_fpvalue)) { - if (_fpvalue < 0) + if (signbit (_fpvalue)) pdata->l_buf[0] = '-'; if (code <= 'G') /* 'A', 'E', 'F', or 'G'. */ cp = "NAN";