зеркало из https://github.com/mozilla/pjs.git
#128154 Crash: opening non-ascii attachments
replace default "default char" from "?" to "_". r=ftang, sr=alecf.
This commit is contained in:
Родитель
be06710717
Коммит
beeba32c31
|
@ -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;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче