public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libstdc++/5182: basic_string::replace may produce incorrect results if part of
@ 2001-12-23 16:26 anonymous
0 siblings, 0 replies; 2+ messages in thread
From: anonymous @ 2001-12-23 16:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 5182
>Category: libstdc++
>Synopsis: basic_string::replace may produce incorrect results if part of
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Dec 23 16:26:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Simon Saunders
>Release: 3.0.3
>Organization:
>Environment:
Red Hat Linux 6.2
>Description:
Calling s.replace(pos, num_chars, s) for a string s may not work
properly if the string already has sufficient capacity for the result.
>How-To-Repeat:
The following test program prints "ABABAB". The correct output is
"ABABCD".
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s("ABCD");
s.reserve(10);
s.replace(2, 2, s);
cout << s << endl;
return 0;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
a string is replaced by itself.
From: simon.saunders@net.ntl.com
Reply-To: simon.saunders@net.ntl.com
X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31)
X-GNATS-Notify:
a string is replaced by itself.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: libstdc++/5182: basic_string::replace may produce incorrect results if part of
@ 2001-12-24 0:31 paolo
0 siblings, 0 replies; 2+ messages in thread
From: paolo @ 2001-12-24 0:31 UTC (permalink / raw)
To: anonymous, gcc-bugs, gcc-prs, nobody, paolo
Synopsis: basic_string::replace may produce incorrect results if part of
Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-By: paolo
Responsible-Changed-When: Mon Dec 24 00:31:29 2001
Responsible-Changed-Why:
Taking care of it
State-Changed-From-To: open->closed
State-Changed-By: paolo
State-Changed-When: Mon Dec 24 00:31:29 2001
State-Changed-Why:
The problem is well known and already fixed in mainline and
in the upcoming 3.0.95 snapshot of the library (a version of
which will be targeted to gcc3.0.x)
Cheers, Paolo.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5182
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-12-24 8:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-23 16:26 libstdc++/5182: basic_string::replace may produce incorrect results if part of anonymous
2001-12-24 0:31 paolo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).