summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdlib/ldtoa.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdlib/ldtoa.c')
-rw-r--r--newlib/libc/stdlib/ldtoa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/newlib/libc/stdlib/ldtoa.c b/newlib/libc/stdlib/ldtoa.c
index bb12f0cc7..5c2972593 100644
--- a/newlib/libc/stdlib/ldtoa.c
+++ b/newlib/libc/stdlib/ldtoa.c
@@ -3153,7 +3153,7 @@ if( digit > 4 )
emovo( y, t, ldp );
if( ecmp(t,ezero) != 0 )
goto roun; /* round to nearest */
- if( (*(s-1) & 1) == 0 )
+ if( ndigs < 0 || (*(s-1-(*(s-1)=='.')) & 1) == 0 )
goto doexp; /* round to even */
}
/* Round up and propagate carry-outs */