Don't allocate a buffer when assigning a zero-length string, just call Truncate() instead (bug 328755). r=darin.

git-svn-id: svn://10.0.0.236/trunk@191323 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bryner%brianryner.com
2006-02-27 19:44:48 +00:00
parent e5449ba452
commit fa9f41637c

View File

@@ -299,7 +299,7 @@ void
nsTSubstring_CharT::Assign( const char_type* data, size_type length )
{
// unfortunately, some callers pass null :-(
if (!data)
if (!data || length == 0)
{
Truncate();
return;