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


Phil Edwards <pedwards@disaster.jaj.com> writes:

| Index: std_sstream.h
| ===================================================================
| RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/std_sstream.h,v
| retrieving revision 1.7
| diff -u -3 -r1.7 std_sstream.h
| --- std_sstream.h	2001/06/12 22:14:08	1.7
| +++ std_sstream.h	2001/07/12 02:52:25
| @@ -75,7 +75,7 @@
|        explicit 
|        basic_stringbuf(const __string_type& __str,
|  		      ios_base::openmode __mode = ios_base::in | ios_base::out)
| -      : __streambuf_type(), _M_string(__str.c_str())
| +      : __streambuf_type(), _M_string(__str.c_str(), __str.size())
|        { _M_stringbuf_init(__mode); }
|  
|        // Get and set:

wouldn't 

+        : __streambuf_type(), _M_string(__str.data(), __str.size())

be even better in this case?

-- 
	Lgb


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