Commit e004c331 by Paolo Carlini Committed by Paolo Carlini

c_locale.cc (__convert_to_v(long double&)): In v3 uses of sscanf...

2004-03-31  Paolo Carlini  <pcarlini@suse.de>

	* config/locale/generic/c_locale.cc (__convert_to_v(long double&)):
	In v3 uses of sscanf, the special floating-point numbers INF,
	INFINITY, etc., cannot occur in input, therefore, if the latter
	is too large, ERANGE is always stored in errno, no need of finitel.

From-SVN: r80247
parent 0ba13880
2004-03-31 Paolo Carlini <pcarlini@suse.de>
* config/locale/generic/c_locale.cc (__convert_to_v(long double&)):
In v3 uses of sscanf, the special floating-point numbers INF,
INFINITY, etc., cannot occur in input, therefore, if the latter
is too large, ERANGE is always stored in errno, no need of finitel.
2004-03-30 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/14783
......
......@@ -128,13 +128,8 @@ namespace std
long double __ld;
errno = 0;
int __p = sscanf(__s, "%Lf", &__ld);
if (errno == ERANGE)
__p = 0;
#ifdef _GLIBCXX_HAVE_FINITEL
if ((__p == 1) && !finitel (__ld))
__p = 0;
#endif
if (__p && static_cast<int_type>(__p) != char_traits<char>::eof())
if (__p && static_cast<int_type>(__p) != char_traits<char>::eof()
&& errno != ERANGE)
__v = __ld;
#endif
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment