Bug 42836. Handle null string in NS_ConvertUCS2toUTF8::Init().

git-svn-id: svn://10.0.0.236/trunk@72465 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
waterson%netscape.com
2000-06-17 01:24:39 +00:00
parent 3f61534047
commit e32e7767b4
3 changed files with 15 additions and 0 deletions

View File

@@ -1862,6 +1862,11 @@ void nsCString::DebugDump(void) const {
void
NS_ConvertUCS2toUTF8::Init( const PRUnichar* aString, PRUint32 aLength )
{
// Handle null string by just leaving us as a brand-new
// uninitialized nsCAutoString.
if (! aString)
return;
// Caculate how many bytes we need
const PRUnichar* p;
PRInt32 count, utf8len;