std_sstream.h (basic_stringbuf::str(const __string_type&)): Prefer data() to c_str() thus avoiding assigning the unnecessary NULL-terminator.
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. From-SVN: r58844
This commit is contained in:
parent
c034b45358
commit
93d87ec6f8
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user