]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
locale_facets.tcc (time_get<>::do_get_weekday, [...]): Absolutely avoid dereferencing...
authorPaolo Carlini <paolo@gcc.gnu.org>
Thu, 18 Nov 2004 10:50:19 +0000 (10:50 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 18 Nov 2004 10:50:19 +0000 (10:50 +0000)
2004-11-18  Paolo Carlini  <pcarlini@suse.de>

* include/bits/locale_facets.tcc (time_get<>::do_get_weekday,
time_get<>::do_get_monthname): Absolutely avoid dereferencing
end iterators.

* include/bits/locale_facets.tcc (time_get<>::_M_extract_name):
Minor tweak.

From-SVN: r90855

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

index 9e2e1480c1c8be3658307c9a495cb58896970993..2944bd4dc3f20862de390d98c35925b1e990049f 100644 (file)
@@ -1,3 +1,12 @@
+2004-11-18  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/bits/locale_facets.tcc (time_get<>::do_get_weekday,
+       time_get<>::do_get_monthname): Absolutely avoid dereferencing
+       end iterators.
+
+       * include/bits/locale_facets.tcc (time_get<>::_M_extract_name):
+       Minor tweak.
+
 2004-11-16  Jonathan Wakely  <redi@gcc.gnu.org>
 
        * docs/html/19_diagnostics/howto.html: Document change from
 
 2004-11-08  Benjamin Kosnik  <bkoz@redhat.com>
 
-        PR libstdc++/17922
-        * include/bits/ios_base.h : Add enum values.
-        * testsuite/testsuite_hooks.h (bitmask_operators): Add function.
-        * testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc: New.
-        * testsuite/27_io/ios_base/types/fmtflags/case_label.cc: New.
-        * testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc: New.
-        * testsuite/27_io/ios_base/types/iostate/case_label.cc: New.
-        * testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc: New.
-        * testsuite/27_io/ios_base/types/openmode/case_label.cc: New.
-        * testsuite/27_io/ios_base/types/seekdir/case_label.cc: New.
-
-        * config/io/c_io_stdio.h (__ios_flags): Mark deprecated.
-        * src/ios.cc: Same.
-
-        * testsuite/27_io/ios_base/cons/assign_neg.cc: Adjust line numbers.
-        * testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
+       PR libstdc++/17922
+       * include/bits/ios_base.h : Add enum values.
+       * testsuite/testsuite_hooks.h (bitmask_operators): Add function.
+       * testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc: New.
+       * testsuite/27_io/ios_base/types/fmtflags/case_label.cc: New.
+       * testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc: New.
+       * testsuite/27_io/ios_base/types/iostate/case_label.cc: New.
+       * testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc: New.
+       * testsuite/27_io/ios_base/types/openmode/case_label.cc: New.
+       * testsuite/27_io/ios_base/types/seekdir/case_label.cc: New.
+
+       * config/io/c_io_stdio.h (__ios_flags): Mark deprecated.
+       * src/ios.cc: Same.
+
+       * testsuite/27_io/ios_base/cons/assign_neg.cc: Adjust line numbers.
+       * testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
 
 2004-11-08  Momchil Velikov  <velco@fadata.bg>
 
index 39caf632e36d7eea86b6f7b9569ea589b920e74d..4f6584432faa1fc0b3acc0df84d9fb6e23961fc0 100644 (file)
@@ -2002,8 +2002,7 @@ namespace std
          for (size_t __i2 = 1; __i2 < __nmatches; ++__i2)
            __minlen = std::min(__minlen,
                              __traits_type::length(__names[__matches[__i2]]));
-         ++__pos;
-         ++__beg;
+         ++__beg, ++__pos;
          if (__pos < __minlen && __beg != __end)
            for (size_t __i3 = 0; __i3 < __nmatches;)
              {
@@ -2020,8 +2019,7 @@ namespace std
       if (__nmatches == 1)
        {
          // Make sure found name is completely extracted.
-         ++__pos;
-         ++__beg;
+         ++__beg, ++__pos;
          __name = __names[__matches[0]];
          const size_t __len = __traits_type::length(__name);
          while (__pos < __len && __beg != __end && __name[__pos] == *__beg)
@@ -2094,7 +2092,7 @@ namespace std
       // __days array with the same index points to a day, and that
       // day's abbreviated form.
       // NB: Also assumes that an abbreviated name is a subset of the name.
-      if (!__err)
+      if (!__err && __beg != __end)
        {
          size_t __pos = __traits_type::length(__days[__tmpwday]);
          __tp._M_days(__days);
@@ -2109,9 +2107,10 @@ namespace std
              if (__len != __pos)
                __err |= ios_base::failbit;
            }
-         if (!__err)
-           __tm->tm_wday = __tmpwday;
        }
+      if (!__err)
+       __tm->tm_wday = __tmpwday;
+      
       if (__beg == __end)
        __err |= ios_base::eofbit;
       return __beg;
@@ -2139,7 +2138,7 @@ namespace std
       // __months array with the same index points to a month, and that
       // month's abbreviated form.
       // NB: Also assumes that an abbreviated name is a subset of the name.
-      if (!__err)
+      if (!__err && __beg != __end)
        {
          size_t __pos = __traits_type::length(__months[__tmpmon]);
          __tp._M_months(__months);
@@ -2154,9 +2153,9 @@ namespace std
              if (__len != __pos)
                __err |= ios_base::failbit;
            }
-         if (!__err)
-           __tm->tm_mon = __tmpmon;
        }
+      if (!__err)
+       __tm->tm_mon = __tmpmon;
 
       if (__beg == __end)
        __err |= ios_base::eofbit;