[uClibc-cvs] svn commit: trunk/uClibc++/include

gkajmowi at uclibc.org gkajmowi at uclibc.org
Thu Jun 30 13:52:26 UTC 2005


Author: gkajmowi
Date: 2005-06-30 07:52:25 -0600 (Thu, 30 Jun 2005)
New Revision: 10649

Log:
Fix implementation of erase() to actually ... erase

Modified:
   trunk/uClibc++/include/string


Changeset:
Modified: trunk/uClibc++/include/string
===================================================================
--- trunk/uClibc++/include/string	2005-06-30 11:27:24 UTC (rev 10648)
+++ trunk/uClibc++/include/string	2005-06-30 13:52:25 UTC (rev 10649)
@@ -283,12 +283,14 @@
 
 	_UCXXEXPORT basic_string& erase(size_type pos = 0, size_type n = npos){
 		size_type xlen = vector<Ch, A>::elements - pos;
+
 		if(xlen > n){
 			xlen = n;
 		}
 		size_type temp = vector<Ch, A>::elements;
+
 		Tr::move(vector<Ch, A>::data + pos, vector<Ch, A>::data + pos + xlen, temp - pos - xlen);
-		resize(pos + xlen);
+		resize(temp - xlen);
 		return *this;
 	}
 




More information about the uClibc-cvs mailing list