nano-vfprintf_float.c: Fix check if negative for nans.

This commit is contained in:
Jon Beniston 2018-12-11 21:03:03 +00:00 committed by Corinna Vinschen
parent df6915f029
commit b3692aed5e
1 changed files with 2 additions and 1 deletions

View File

@ -39,6 +39,7 @@
#include <string.h>
#include <limits.h>
#include <stdint.h>
#include <math.h>
#include <wchar.h>
#include <sys/lock.h>
#include <stdarg.h>
@ -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";