Author: sebor
Date: Sun Feb 19 22:23:54 2006
New Revision: 379035

URL: http://svn.apache.org/viewcvs?rev=379035&view=rev
Log:
2006-02-19  Martin Sebor  <[EMAIL PROTECTED]>

        * streambuf.cc (xsputn): Asserted a precondition and simplified
        no-op detection.

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

Modified: incubator/stdcxx/trunk/include/streambuf.cc
URL: 
http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/include/streambuf.cc?rev=379035&r1=379034&r2=379035&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/streambuf.cc (original)
+++ incubator/stdcxx/trunk/include/streambuf.cc Sun Feb 19 22:23:54 2006
@@ -3,7 +3,7 @@
  *
  * streambuf.cc - definitions of basic_streambuf members
  *
- * $Id: //stdlib/dev/include/streambuf.cc#12 $
+ * $Id$
  *
  ***************************************************************************
  *
@@ -91,9 +91,10 @@
 basic_streambuf<_CharT, _Traits>::
 xsputn (const char_type* __buf, streamsize __n)
 {
+    _RWSTD_ASSERT (0 != __buf || 0 == __n);
     _RWSTD_ASSERT (_C_is_valid ());
 
-    if (!__buf || !__n || !_C_is_out ())
+    if (__n <= 0 || !_C_is_out ())
         return 0;
 
     streamsize __nput = 0;


Reply via email to