summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3
diff options
context:
space:
mode:
authordgregor <dgregor@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-30 20:45:22 +0000
committerdgregor <dgregor@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-30 20:45:22 +0000
commitf7ac2020767662a11decb342e9d3a9b718ce7235 (patch)
tree23576a475d75a761878512a47dfa50b1fba71c5d /libstdc++-v3
parent2e36f9f8eb7453c662eea75bf21ed4feb6fe403d (diff)
downloadppe42-gcc-f7ac2020767662a11decb342e9d3a9b718ce7235.tar.gz
ppe42-gcc-f7ac2020767662a11decb342e9d3a9b718ce7235.zip
Avoid subscripting empty string.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68739 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/bits/locale_facets.tcc2
2 files changed, 6 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 65b0cd9b095..1a440fbd165 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2003-06-30 Doug Gregor <dgregor@apple.com>
+
+ * include/bits/locale_facets.tcc (money_get::do_get): Avoid
+ subscripting empty string.
+
2003-06-30 Phil Edwards <pme@gcc.gnu.org>
* testsuite/Makefile.am (check-am): Do not override.
diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc
index 5081591c1cb..aca0e056d67 100644
--- a/libstdc++-v3/include/bits/locale_facets.tcc
+++ b/libstdc++-v3/include/bits/locale_facets.tcc
@@ -1272,7 +1272,7 @@ namespace std
}
// Strip leading zeros.
- while (__tmp_units[0] == __ctype.widen('0'))
+ while (!__tmp_units.empty() && __tmp_units[0] == __ctype.widen('0'))
__tmp_units.erase(__tmp_units.begin());
if (__sign.size() && __sign == __neg_sign)
OpenPOWER on IntegriCloud