stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r328959 - /incubator/stdcxx/trunk/include/istream.cc
Date Thu, 27 Oct 2005 21:58:36 GMT
Author: sebor
Date: Thu Oct 27 14:58:32 2005
New Revision: 328959

URL: http://svn.apache.org/viewcvs?rev=328959&view=rev
Log:
2005-10-27  Martin Sebor  <sebor@roguewave.com>

	STDCXX-60
	* istream.cc (get): On failure, stored the NUL character in the first
	location of the array as required by DR 243.


Modified:
    incubator/stdcxx/trunk/include/istream.cc

Modified: incubator/stdcxx/trunk/include/istream.cc
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/include/istream.cc?rev=328959&r1=328958&r2=328959&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/istream.cc (original)
+++ incubator/stdcxx/trunk/include/istream.cc Thu Oct 27 14:58:32 2005
@@ -2,7 +2,7 @@
  *
  * istream.cc - istream definitions
  *
- * $Id: //stdlib/dev/include/istream.cc#48 $
+ * $Id$
  *
  ***************************************************************************
  *
@@ -577,9 +577,15 @@
 {
     _RWSTD_ASSERT (0 != this->rdbuf ());
 
-    ios_base::iostate __err = ios_base::goodbit;
+    if (0 < __n) {
+        // lwg issue 243: store the NUL character before
+        // constructing the sentry object in case it throws
+        traits_type::assign (__s [0], char_type ());
+    }
 
     const sentry __ipfx (*this, true /* noskipws */);
+
+    ios_base::iostate __err = ios_base::goodbit;
 
     if (__ipfx) {
 



Mime
View raw message