Backed out changeset 4742998f817e (bug 1933078) for causing build bustage. rs=backout,bustage-fix

--HG--
extra : amend_source : 0368570a2f696fdd3c34f3273275519d8df53e1b
This commit is contained in:
Alessandro Castellani 2024-11-25 13:14:52 -08:00
Родитель 0cc2c027e1
Коммит 701c072b9f
5 изменённых файлов: 27 добавлений и 10 удалений

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

@ -2649,11 +2649,11 @@ void nsImapProtocol::IncrementCommandTagNumber() {
} else if (++m_currentServerCommandTagNumber == 0) {
m_currentServerCommandTagNumber = 1;
}
m_currentServerCommandTag = nsPrintfCString("%u", m_currentServerCommandTagNumber);
sprintf(m_currentServerCommandTag, "%u", m_currentServerCommandTagNumber);
}
const char* nsImapProtocol::GetServerCommandTag() {
return m_currentServerCommandTag.get();
return m_currentServerCommandTag;
}
/**

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

@ -534,7 +534,9 @@ class nsImapProtocol : public nsIImapProtocol,
RefPtr<nsImapFlagAndUidState> m_flagState;
nsMsgBiffState m_currentBiffState;
// manage the IMAP server command tags
nsCString m_currentServerCommandTag;
// 11 = enough memory for the decimal representation of MAX_UINT + trailing
// nul
char m_currentServerCommandTag[11];
uint32_t m_currentServerCommandTagNumber;
void IncrementCommandTagNumber();
const char* GetServerCommandTag();

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

@ -1067,10 +1067,13 @@ void nsImapServerResponseParser::msg_fetch() {
if (fSizeOfMostRecentMessage == 0 && CurrentResponseUID()) {
// on no, bogus Netscape 2.0 mail server bug
char uidString[100];
sprintf(uidString, "%ld", (long)CurrentResponseUID());
if (!fZeroLengthMessageUidString.IsEmpty())
fZeroLengthMessageUidString += ",";
fZeroLengthMessageUidString.AppendInt(CurrentResponseUID());
fZeroLengthMessageUidString += uidString;
}
// if this token ends in ')', then it is the last token

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

@ -276,14 +276,20 @@ static void MimePgpe_free(MimeClosure output_closure) {
This is not a full URL, just a part-number.
*/
static nsCString determineMimePart(MimeObject* obj) {
char mimePartNum[20];
MimeObject* kid;
MimeContainer* cont;
int32_t i;
nsCString mimePart;
while (obj->parent) {
auto* cont = (MimeContainer*)obj->parent;
for (int32_t i = 0; i < cont->nchildren; i++) {
auto* kid = cont->children[i];
cont = (MimeContainer*)obj->parent;
for (i = 0; i < cont->nchildren; i++) {
kid = cont->children[i];
if (kid == obj) {
mimePart.Insert(nsPrintfCString(".%d", i + 1), 0);
sprintf(mimePartNum, ".%d", i + 1);
mimePart.Insert(mimePartNum, 0);
}
}
obj = obj->parent;

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

@ -22,9 +22,12 @@ nsMimeXmlEmitter::~nsMimeXmlEmitter(void) {}
// anything to the stream since these may be image data
// output streams, etc...
nsresult nsMimeXmlEmitter::Complete() {
char buf[16];
// Now write out the total count of attachments for this message
UtilityWrite("<mailattachcount>");
UtilityWrite(nsPrintfCString("%d", mAttachCount));
sprintf(buf, "%d", mAttachCount);
UtilityWrite(buf);
UtilityWrite("</mailattachcount>");
UtilityWrite("</message>");
@ -123,9 +126,12 @@ nsresult nsMimeXmlEmitter::StartAttachment(const nsACString& name,
const char* contentType,
const char* url,
bool aIsExternalAttachment) {
char buf[128];
++mAttachCount;
UtilityWrite(nsPrintfCString("<mailattachment id=\"%d\">", mAttachCount));
sprintf(buf, "<mailattachment id=\"%d\">", mAttachCount);
UtilityWrite(buf);
AddAttachmentField(HEADER_PARM_FILENAME, PromiseFlatCString(name).get());
return NS_OK;