Closed Bug 733674 Opened 12 years ago Closed 12 years ago

B2G SMS: Fix off-by-one errors in timestamp computation

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: philikon, Assigned: philikon)

References

Details

Attachments

(1 file)

Don't know what I was smoking at the time, but that code definitely ain't right, as jstraus points out:

      let year   = this.readSwappedNibbleBCD(1) + PDU_TIMESTAMP_YEAR_OFFSET;
      let month  = this.readSwappedNibbleBCD(1) - 1;
      let day    = this.readSwappedNibbleBCD(1) - 1;
      let hour   = this.readSwappedNibbleBCD(1) - 1;
      let minute = this.readSwappedNibbleBCD(1) - 1;
      let second = this.readSwappedNibbleBCD(1) - 1;

year and month are correct, the rest isn't.
Blocks: b2g-sms
Attached patch v1Splinter Review
Attachment #603606 - Flags: review?(kyle)
Attachment #603606 - Flags: review?(kyle) → review+
https://hg.mozilla.org/mozilla-central/rev/7813816f7ff4
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: