[Scummvm-cvs-logs] SF.net SVN: scummvm: [21931] scummvm/trunk/common/str.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Apr 16 02:13:03 CEST 2006


Revision: 21931
Author:   fingolfin
Date:     2006-04-16 02:12:27 -0700 (Sun, 16 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21931&view=rev

Log Message:
-----------
Fixed evil longstanding bug in String::toLowercase & toUppercase: Before modifying the string content, make sure we do not share it with any other string). This should help (hopefully fix) bug #1470892

Modified Paths:
--------------
    scummvm/trunk/common/str.cpp
Modified: scummvm/trunk/common/str.cpp
===================================================================
--- scummvm/trunk/common/str.cpp	2006-04-16 06:49:13 UTC (rev 21930)
+++ scummvm/trunk/common/str.cpp	2006-04-16 09:12:27 UTC (rev 21931)
@@ -216,6 +216,7 @@
 	if (_str == 0 || _len == 0)
 		return;
 
+	ensureCapacity(_len, true);
 	for (int i = 0; i < _len; ++i)
 		_str[i] = tolower(_str[i]);
 }
@@ -224,6 +225,7 @@
 	if (_str == 0 || _len == 0)
 		return;
 
+	ensureCapacity(_len, true);
 	for (int i = 0; i < _len; ++i)
 		_str[i] = toupper(_str[i]);
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list