diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-11-06 00:05:35 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-11-06 00:05:35 +0000 |
commit | f89577a87739d6b315adca07a00e22d0592e86db (patch) | |
tree | 3140e3917b07f9a0548a9698423a5be6338b8ba8 | |
parent | 0bfb37bc56211bfc243390df14ab06955bc869cd (diff) | |
download | gcc-f89577a87739d6b315adca07a00e22d0592e86db.tar.gz |
2002-11-05 Jonathan Wakely <cow@compsoc.man.ac.uk>
* include/std/std_sstream.h
(basic_stringbuf::str(const __string_type&)):
Prefer data() to c_str() thus avoiding assigning the
unnecessary NULL-terminator.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58844 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libstdc++-v3/ChangeLog | 7 | ||||
-rw-r--r-- | libstdc++-v3/include/std/std_sstream.h | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 2675d278274..b6b5d906079 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2002-11-05 Jonathan Wakely <cow@compsoc.man.ac.uk> + + * include/std/std_sstream.h + (basic_stringbuf::str(const __string_type&)): + Prefer data() to c_str(), thus avoiding assigning the + unnecessary NULL-terminator. + 2002-11-05 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/8258 diff --git a/libstdc++-v3/include/std/std_sstream.h b/libstdc++-v3/include/std/std_sstream.h index 5eb43d09e59..6ee75053148 100644 --- a/libstdc++-v3/include/std/std_sstream.h +++ b/libstdc++-v3/include/std/std_sstream.h @@ -106,7 +106,7 @@ namespace std str(const __string_type& __s) { // Cannot use _M_string = __s, since v3 strings are COW. - _M_string.assign(__s.c_str(), __s.size()); + _M_string.assign(__s.data(), __s.size()); _M_stringbuf_init(_M_mode); } |