зеркало из https://github.com/mozilla/gecko-dev.git
Bug 969878 - Do not try to check the return value of nsTArray::SetLength in nsDateTimeFormatMac::FormatTMTime; r=smontagu
This size is not controllable from content. and nsTArray::SetLength's return value is always true for now (I'm converting it to void in bug 969864.)
This commit is contained in:
Родитель
6c8a6323f2
Коммит
8c0ee15eb7
|
@ -214,18 +214,17 @@ nsresult nsDateTimeFormatMac::FormatTMTime(nsILocale* locale,
|
|||
CFStringRef formattedDate = CFDateFormatterCreateStringWithAbsoluteTime(nullptr,
|
||||
formatter,
|
||||
absTime);
|
||||
|
||||
|
||||
CFIndex stringLen = CFStringGetLength(formattedDate);
|
||||
|
||||
|
||||
nsAutoTArray<UniChar, 256> stringBuffer;
|
||||
if (stringBuffer.SetLength(stringLen + 1)) {
|
||||
CFStringGetCharacters(formattedDate, CFRangeMake(0, stringLen), stringBuffer.Elements());
|
||||
stringOut.Assign(reinterpret_cast<char16_t*>(stringBuffer.Elements()), stringLen);
|
||||
}
|
||||
|
||||
stringBuffer.SetLength(stringLen + 1);
|
||||
CFStringGetCharacters(formattedDate, CFRangeMake(0, stringLen), stringBuffer.Elements());
|
||||
stringOut.Assign(reinterpret_cast<char16_t*>(stringBuffer.Elements()), stringLen);
|
||||
|
||||
CFRelease(formattedDate);
|
||||
CFRelease(formatter);
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче