This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] Slight improvement of libstdc++/8466 fix


Hi again,

a slight improvement suggested by Jon.

Tested x86-linux, committed.

Ciao, Paolo.

/////////////

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.
diff -urN libstdc++-v3-orig/include/std/std_sstream.h libstdc++-v3/include/std/std_sstream.h
--- libstdc++-v3-orig/include/std/std_sstream.h	2002-11-05 23:05:44.000000000 +0100
+++ libstdc++-v3/include/std/std_sstream.h	2002-11-06 00:54:03.000000000 +0100
@@ -106,7 +106,7 @@
       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);
       }
 

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