You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by fa...@apache.org on 2007/07/24 17:32:41 UTC

svn commit: r559084 - /incubator/stdcxx/trunk/include/string.cc

Author: faridz
Date: Tue Jul 24 08:32:40 2007
New Revision: 559084

URL: http://svn.apache.org/viewvc?view=rev&rev=559084
Log:
2007-07-24 Farid Zaripov <Fa...@epam.com>

	STDCXX-175
	* string.cc (replace): Throw std::length_error() if __n2 > max_size().

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

Modified: incubator/stdcxx/trunk/include/string.cc
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/string.cc?view=diff&rev=559084&r1=559083&r2=559084
==============================================================================
--- incubator/stdcxx/trunk/include/string.cc (original)
+++ incubator/stdcxx/trunk/include/string.cc Tue Jul 24 08:32:40 2007
@@ -346,6 +346,12 @@
     // number of characters to delete
     const size_type __xlen = _C_min (__n1, __size0 - __pos1);
 
+    _RWSTD_REQUIRES (__n2 <= max_size (),
+                     (_RWSTD_ERROR_LENGTH_ERROR,
+                     _RWSTD_FUNC ("basic_string::replace(size_type, size_type"
+                                  ", const_pointer, size_type)"), 
+                     __n2, max_size()));
+
     _RWSTD_REQUIRES (__size0 - __xlen <= max_size () - __n2,
                      (_RWSTD_ERROR_LENGTH_ERROR,
                      _RWSTD_FUNC ("basic_string::replace(size_type, size_type"