This is the mail archive of the
mailing list for the libstdc++ project.
Re: [v3] Fix stringbuf handling of NUL characters
On Sat, Jul 14, 2001 at 02:49:39AM +0200, Carlo Wood wrote:
> On Fri, Jul 13, 2001 at 04:24:23PM -0400, Phil Edwards wrote:
> > But that's not c_str()'s fault. Both c_str() and data() simply return a
> > pointer to the character string. A second NUL character (which will never
> > be seen) won't make any difference.
> > It's just occurred to me that we may be talking about different things
> > anyhow. :-)
> It irrelevant for the patch anyway, you should use data() if only because
> it is faster.
Yep, I believe I said exactly that a few days ago. :-)
As an aside, I looked through the stringbuf/stringstream code for other
instances of c_str(), and there are none. In fact, we use surprisingly
few member functions of basic_string, which I consider to be a good thing.
Would I had phrases that are not known, utterances that are strange, in
new language that has not been used, free from repetition, not an utterance
which has grown stale, which men of old have spoken.
- anonymous Egyptian scribe, c.1700 BC