[v3] Fix stringbuf handling of NUL characters
Phil Edwards
pedwards@disaster.jaj.com
Fri Jul 13 13:28:00 GMT 2001
On Thu, Jul 12, 2001 at 11:04:42AM -0500, Benjamin Kosnik wrote:
>
> Hmm. Can I see a testcase entry for this?
This is a distilled version of what I plan to check in:
1 std::string string_with_nulls ("123 \0 456", 9);
2 std::stringbuf sbuf (string_with_nulls);
sbuf.str().size() should be 9, but right now, it's only 4. The user in
the original bug report was constructing (indirectly) a string like the
one on line 1. But inside istringstream, when we created its stringbuf
with something like line 2, we were allowing a strlen() call to determine
how much data to copy.
Phil
--
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
More information about the Libstdc++
mailing list