#128154 Crash: opening non-ascii attachments

replace default "default char" from "?" to "_".
r=ftang, sr=alecf.
This commit is contained in:
shanjian%netscape.com 2002-04-16 04:10:54 +00:00
Родитель 98bab6ee7f
Коммит a1a1517f87
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -2171,9 +2171,12 @@ static nsresult UCS2toFS(const PRUnichar *aBuffer, char **aResult)
if (!*aResult)
return NS_ERROR_OUT_OF_MEMORY;
// default "defaultChar" is '?', which is an illegal character on windows file system.
// That will cause file uncreatable. Change it to '_'
const char defaultChar = '_';
chars = ::WideCharToMultiByte(CP_ACP, 0,
aBuffer, -1,
*aResult, chars, NULL, NULL);
*aResult, chars, &defaultChar, NULL);
if (chars == 0)
return NS_ERROR_FAILURE;