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

RESOLVED FIXED in mozilla13

Status

()

Core
DOM: Device Interfaces
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: philikon, Assigned: philikon)

Tracking

Trunk
mozilla13
ARM
Gonk (Firefox OS)
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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.
(Assignee)

Updated

6 years ago
Blocks: 709564
Created attachment 603606 [details] [diff] [review]
v1
Attachment #603606 - Flags: review?(kyle)
https://hg.mozilla.org/mozilla-central/rev/7813816f7ff4
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Assignee)

Updated

6 years ago
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.