From: paolo Date: Wed, 6 Nov 2002 00:05:35 +0000 (+0000) Subject: 2002-11-05 Jonathan Wakely X-Git-Tag: upstream/4.9.2~83547 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f89577a87739d6b315adca07a00e22d0592e86db;p=platform%2Fupstream%2Flinaro-gcc.git 2002-11-05 Jonathan Wakely * 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 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 2675d27..b6b5d90 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2002-11-05 Jonathan Wakely + + * 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 PR libstdc++/8258 diff --git a/libstdc++-v3/include/std/std_sstream.h b/libstdc++-v3/include/std/std_sstream.h index 5eb43d0..6ee7505 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); }