Closed Bug 1012807 Opened 11 years ago Closed 7 months ago

convert nsMsgUtils.cpp::MsgStripQuotedPrintable(unsigned char *src) to 'const char*'

Categories

(MailNews Core :: Backend, defect)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: aceman, Assigned: aceman)

References

Details

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #853159 comment 32 +++ neil@parkwaycc.co.uk 2014-05-19 00:27:55 CEST (In reply to aceman from comment #30) > > [Given that there are hardly any uses of token left, you might as well just > > use src + srcIdx + 1 directly.] > Yes, except the ugly cast from unsigned char* to const char*. Oops, both callers ugly cast from const char* to unsigned char* (which is worse, because it's casting away const!) Obviously that needs to be fixed in a separate bug, but that will therefore simplify these uses too.
Attached patch patchSplinter Review
Attachment #8425003 - Flags: review?(neil)
Comment on attachment 8425003 [details] [diff] [review] patch Actually const char* is also wrong, because we're still casting away const (this time in MsgStripQuotedPrintable itself). You have three choices: * Pass char* and use BeginWriting() instead of get() * Pass nsCString& and use BeginWriting inside MsgStripQuotedPrintable * Pass nsACString& and use string manipulation methods Note that for the latter two you can also update the length at the same time.
Attachment #8425003 - Flags: review?(neil) → review-
Severity: trivial → S4

This was fixed by bug 1408175.

Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → WORKSFORME
See Also: → 1408175
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: