simple bastring bug [egcs-1.03a (2.90.29)]

Ulrich Drepper drepper@cygnus.com
Wed Jul 22 17:33:00 GMT 1998


mauer@math.uiuc.edu (Andrew Mauer-Oats) writes:

> It appears that appending a character string to a "string" does not
> give a null-terminated string. The appended test program shows this.
> I do not think this should be the behaviour. To copy the terminating
> null, one should use traits::length(s)+1 when appending/replacing. 

This is the expected behaviour.  If you want to see the string NUL
terminated call c_str().

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------



More information about the Gcc-bugs mailing list