OSDN Git Service

Avoid subscripting empty string.
authordgregor <dgregor@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Jun 2003 20:45:22 +0000 (20:45 +0000)
committerdgregor <dgregor@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Jun 2003 20:45:22 +0000 (20:45 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68739 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/locale_facets.tcc

index 65b0cd9..1a440fb 100644 (file)
@@ -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.
index 5081591..aca0e05 100644 (file)
@@ -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)