This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


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

Re: [v3] Fix stringbuf handling of NUL characters




> 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.

Ok. With this, and assuming you made the change to string::data(), I think
this is ready to go in as well.

thanks again,
benjamin


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