Closed Bug 212114 Opened 22 years ago Closed 22 years ago

FormatStatusMessage broken for aStatusArg with more than two args

Categories

(Core :: Internationalization, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jag+mozilla, Assigned: jag+mozilla)

References

()

Details

Attachments

(1 file)

804 PRInt32 pos = args.FindChar('\n', offset); 805 if (pos == -1) 806 pos = args.Length(); 807 argArray[i] = ToNewUnicode(Substring(args, offset, pos)); This should be |Substring(args, offset, pos - offset)|, since the third param is a length one. For just one arg it'll be fine since offset is 0, and if there are only two args, |Substring| will just take |NS_MIN(offset + pos /*args.Length()*/, args.Length())| for the length param. For more than two args the ones in the middle will go beyond the \n.
Attached patch Fix oopsSplinter Review
Note that the old code |args.Mid(arg, offset, pos)| was doing this incorrectly too.
Attachment #127289 - Flags: superreview?(dbaron)
Attachment #127289 - Flags: review?(darin)
Comment on attachment 127289 [details] [diff] [review] Fix oops r=darin
Attachment #127289 - Flags: review?(darin) → review+
Attachment #127289 - Flags: superreview?(dbaron) → superreview+
Checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: