aboutsummaryrefslogtreecommitdiff
path: root/stdlib/strtod_l.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-04-25 17:56:10 +0000
committerUlrich Drepper <drepper@redhat.com>2009-04-25 17:56:10 +0000
commit4bbf8999f4d93c5da77737ccf06a1aa67225d3f4 (patch)
tree3b4c86746c51d3c123d97e381b1064a75e2462ca /stdlib/strtod_l.c
parentaf9f1c486e9f41637aac1e0dd4fd192a23a0d150 (diff)
downloadglibc-4bbf8999f4d93c5da77737ccf06a1aa67225d3f4.zip
glibc-4bbf8999f4d93c5da77737ccf06a1aa67225d3f4.tar.gz
glibc-4bbf8999f4d93c5da77737ccf06a1aa67225d3f4.tar.bz2
* stdlib/strtod_l.c (round_and_return): We have to set errno to
ERANGE for underflows. * stdlib/tst-strtod.c (tests): Two tests should set errno to ERANGE.
Diffstat (limited to 'stdlib/strtod_l.c')
-rw-r--r--stdlib/strtod_l.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c
index 09a8f9b..9ddfa3f 100644
--- a/stdlib/strtod_l.c
+++ b/stdlib/strtod_l.c
@@ -1,5 +1,5 @@
/* Convert string representing a number to float value, using given locale.
- Copyright (C) 1997,1998,2002,2004,2005,2006,2007,2008
+ Copyright (C) 1997,1998,2002,2004,2005,2006,2007,2008,2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -232,6 +232,7 @@ round_and_return (mp_limb_t *retval, int exponent, int negative,
# define DENORM_EXP (MIN_EXP - 2)
#endif
exponent = DENORM_EXP;
+ __set_errno (ERANGE);
}
if ((round_limb & (((mp_limb_t) 1) << round_bit)) != 0