This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


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

bug in string::substr?


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



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