summaryrefslogtreecommitdiff
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.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/stdio-common/printf_fphex.c b/stdio-common/printf_fphex.c
index fd790d5bf3..4e30d94c61 100644
--- a/stdio-common/printf_fphex.c
+++ b/stdio-common/printf_fphex.c
@@ -1,5 +1,5 @@
/* Print floating point number in hexadecimal notation according to ISO C99.
- Copyright (C) 1997-2002,2004 Free Software Foundation, Inc.
+ Copyright (C) 1997-2002,2004,2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -399,12 +399,15 @@ __printf_fphex (FILE *fp,
++leading;
else
{
- leading = 1;
+ leading = '1';
if (expnegative)
{
- exponent += 4;
- if (exponent >= 0)
- expnegative = 0;
+ exponent -= 4;
+ if (exponent <= 0)
+ {
+ exponent = -exponent;
+ expnegative = 0;
+ }
}
else
exponent += 4;