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]

Re: basic_string termination failure in libstdc++


On Feb 21, 1999, Josh Stern <jstern@citilink.com> wrote:

> I've experienced bugs in several pieces of C++ code where
> a basic_string<char> was not properly terminated with a '\0'

It doesn't have to, as it keeps track of its size out-of-band.  Maybe
you're calling data() where you should be calling c_str(), or just
assuming that strings are null terminated?

-- 
Alexandre Oliva  http://www.dcc.unicamp.br/~oliva  aoliva@{acm.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Universidade Estadual de Campinas, SP, Brasil



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