Fix for bug 43892; properly calculate unicode string length; r=matt@netscape.com

This commit is contained in:
law%netscape.com 2000-06-27 01:30:23 +00:00
parent 888cb9091a
commit 7178aef1c7

View File

@ -436,7 +436,7 @@ PRUnichar * nsFilePicker::ConvertFromFileSystemCharset(const char *inString)
PRInt32 outLength;
rv = mUnicodeDecoder->GetMaxLength(inString, inLength, &outLength);
if (NS_SUCCEEDED(rv)) {
outString = NS_STATIC_CAST( PRUnichar*, nsMemory::Alloc( outLength+1 * sizeof( PRUnichar ) ) );
outString = NS_STATIC_CAST( PRUnichar*, nsMemory::Alloc( (outLength+1) * sizeof( PRUnichar ) ) );
if (nsnull == outString) {
return nsnull;
}