aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2002-01-11 20:12:02 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2002-01-11 20:12:02 +0000
commit87a9c33cb1d5df7ab606e290ea8b37d22fae4569 (patch)
tree2ac161a393d4c52a344527ecfdb70dec328c1baa /libstdc++-v3/include
parent96ae8197d279fbb1d801ae88ff36ca963b5e741a (diff)
downloadgcc-87a9c33cb1d5df7ab606e290ea8b37d22fae4569.zip
gcc-87a9c33cb1d5df7ab606e290ea8b37d22fae4569.tar.gz
gcc-87a9c33cb1d5df7ab606e290ea8b37d22fae4569.tar.bz2
locale_facets.tcc (money_get::do_get(string)): Check for zero-length negative sign before adding it to output string.
2002-01-11 Benjamin Kosnik <bkoz@redhat.com> * include/bits/locale_facets.tcc (money_get::do_get(string)): Check for zero-length negative sign before adding it to output string. (money_get::do_get(long double)): Return beg. * testsuite/22_locale/money_get_members_char.cc (test02): Add iterator checks. * testsuite/22_locale/money_get_members_wchar_t.cc: Same. From-SVN: r48777
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r--libstdc++-v3/include/bits/locale_facets.tcc4
1 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc
index 6e0e8b9..35873e1 100644
--- a/libstdc++-v3/include/bits/locale_facets.tcc
+++ b/libstdc++-v3/include/bits/locale_facets.tcc
@@ -1035,7 +1035,7 @@ namespace std
ios_base::iostate& __err, long double& __units) const
{
string_type __str;
- this->do_get(__beg, __end, __intl, __io, __err, __str);
+ __beg = this->do_get(__beg, __end, __intl, __io, __err, __str);
const int __n = numeric_limits<long double>::digits10;
char* __cs = static_cast<char*>(__builtin_alloca(sizeof(char) * __n));
@@ -1222,7 +1222,7 @@ namespace std
while (__units[0] == __ctype.widen('0'))
__units.erase(__units.begin());
- if (__sign == __neg_sign)
+ if (__sign.size() && __sign == __neg_sign)
__units.insert(__units.begin(), __ctype.widen('-'));
// Test for grouping fidelity.