This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: basic_string termination failure in libstdc++
- To: Josh Stern <jstern at citilink dot com>
- Subject: Re: basic_string termination failure in libstdc++
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 22 Feb 1999 04:22:38 -0300
- Cc: egcs-bugs at egcs dot cygnus dot com, jstern at citilnk dot com
- References: <199902220251.UAA26334@foshay.citilink.com>
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