This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
bug in string::substr?
- To: <libstdc++ at sourceware dot cygnus dot com>
- Subject: bug in string::substr?
- From: "Gerd v. Egidy" <egidy at deam dot de>
- Date: Thu, 18 Nov 1999 01:55:53 +0100
Hi,
i use libstdc++ 2.90.6.1 and gcc 2.95.1 and got a segfault within one of my programs.
i tracked it down to this:
string x="abc";
string y;
y=x.substr(1,0);
cerr << y << "\n";
it looks like a substr(x,0) kills the string somehow. i don't exactly know if this is allowed
in ANSI C++, but i think it should at least throw a exception if not.
Regards,
Gerd