OSDN Git Service

2004-10-10 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / include / bits / sstream.tcc
index 76cda29..86daa6d 100644 (file)
@@ -109,7 +109,8 @@ namespace std
          const __size_type __len = std::min(__opt_len, __max_size);
          __string_type __tmp;
          __tmp.reserve(__len);
-         __tmp.assign(_M_string.data(), this->epptr() - this->pbase());
+         if (this->pbase())
+           __tmp.assign(this->pbase(), this->epptr() - this->pbase());
          _M_string.swap(__tmp);
          _M_sync(const_cast<char_type*>(_M_string.data()),
                  this->gptr() - this->eback(), this->pptr() - this->pbase());
@@ -205,7 +206,7 @@ namespace std
                this->gbump((__beg + __pos) - this->gptr());
              if (__testout)
                 this->pbump((__beg + __pos) - this->pptr());
-             __ret = pos_type(off_type(__pos));
+             __ret = __sp;
            }
        }
       return __ret;