This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/16958] New: std::stringbuf::seekoff return wrong position value


std::stringbuf::seekoff return wrong position value.
solution: patch:

--- include/bits/sstream.tcc.orig	2004-08-10 17:11:28.000000000 +0800
+++ include/bits/sstream.tcc	2004-08-10 17:11:59.000000000 +0800
@@ -160,14 +160,14 @@
 	      && this->egptr() - __beg >= __newoffi + __off)
 	    {
 	      this->gbump((__beg + __newoffi + __off) - this->gptr());
-	      __ret = pos_type(__newoffi);
+	      __ret = pos_type(__newoffi + __off);
 	    }
 	  if ((__testout || __testboth)
 	      && __newoffo + __off >= 0
 	      && this->egptr() - __beg >= __newoffo + __off)
 	    {
 	      this->pbump((__beg + __newoffo + __off) - this->pptr());
-	      __ret = pos_type(__newoffo);
+	      __ret = pos_type(__newoffo + __off);
 	    }
 	}
       return __ret;

-- 
           Summary: std::stringbuf::seekoff return wrong position value
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sepherosa at softhome dot net
                CC: gcc-bugs at gcc dot gnu dot org,sepherosa at softhome
                    dot net
 GCC build triplet: gcc version 3.4.1 20040618 [DragonFly] (prerelease)
  GCC host triplet: gcc version 3.4.1 20040618 [DragonFly] (prerelease)
GCC target triplet: gcc version 3.4.1 20040618 [DragonFly] (prerelease)


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16958


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]