about summary refs log tree commit diff
path: root/stdio-common/printf_fphex.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/printf_fphex.c')
-rw-r--r--stdio-common/printf_fphex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stdio-common/printf_fphex.c b/stdio-common/printf_fphex.c
index 4e30d94c61..551c873c5e 100644
--- a/stdio-common/printf_fphex.c
+++ b/stdio-common/printf_fphex.c
@@ -172,6 +172,7 @@ __printf_fphex (FILE *fp,
       /* Check for special values: not a number or infinity.  */
       if (__isnanl (fpnum.ldbl.d))
 	{
+	  negative = fpnum.ldbl.ieee.negative != 0;
 	  if (isupper (info->spec))
 	    {
 	      special = "NAN";
@@ -182,7 +183,6 @@ __printf_fphex (FILE *fp,
 	      special = "nan";
 	      wspecial = L"nan";
 	    }
-	  negative = 0;
 	}
       else
 	{
@@ -211,6 +211,7 @@ __printf_fphex (FILE *fp,
       /* Check for special values: not a number or infinity.  */
       if (__isnan (fpnum.dbl.d))
 	{
+	  negative = fpnum.dbl.ieee.negative != 0;
 	  if (isupper (info->spec))
 	    {
 	      special = "NAN";
@@ -221,7 +222,6 @@ __printf_fphex (FILE *fp,
 	      special = "nan";
 	      wspecial = L"nan";
 	    }
-	  negative = 0;
 	}
       else
 	{