From: Jon Beniston Date: Tue, 11 Dec 2018 21:03:03 +0000 (+0000) Subject: nano-vfprintf_float.c: Fix check if negative for nans. X-Git-Tag: newlib-snapshot-20181231~17 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=b3692aed5e48b6107afba6aab21d03191dc80117;p=newlib-cygwin.git nano-vfprintf_float.c: Fix check if negative for nans. --- diff --git a/newlib/libc/stdio/nano-vfprintf_float.c b/newlib/libc/stdio/nano-vfprintf_float.c index 071a09edc..524f67a31 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";