Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-640

std::num_get::do_get() parses no more than 128 characters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 4.1.2, 4.1.3, 4.1.4, 4.2.0
    • 4.2.2
    • 22. Localization
    • None
    • All

    • Patch Available
    • Incorrect Behavior

    Description

      The following program fails on assert.

      #include <cassert>
      #include <sstream>
      #include <string>
      
      int main ()
      {
          typedef std::num_get<char> NumGet;
          typedef std::istreambuf_iterator<char> Iter;
      
          std::locale loc;
      
          for (unsigned i = 0; i < 10000; ++i) {
              std::string s (i, '0');
              s.push_back ('1');
      
              std::istringstream is (s);
      
              std::ios::iostate state = std::ios::goodbit;
              long val = 0;
      
              std::use_facet<NumGet> (loc).get (Iter (is), Iter (), is, state, val);
              assert (1 == val && std::ios::eofbit == state);
          }
      
          return 0;
      }
      

      Attachments

        1. stdcxx-640.patch
          11 kB
          Farid Zaripov

        Issue Links

          Activity

            People

              Unassigned Unassigned
              farid Farid Zaripov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 4h
                  4h
                  Remaining:
                  Remaining Estimate - 4h
                  4h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified