From: Santiago Carot-Nemesio <sancane@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Santiago Carot-Nemesio <sancane@gmail.com>
Subject: [PATCH] Fix bad epoch time stamp generation
Date: Fri, 25 Nov 2011 16:37:28 +0100 [thread overview]
Message-ID: <1322235448-9638-1-git-send-email-sancane@gmail.com> (raw)
The number of months is in the range 0 to 11, we have to decrease
month number by 1 before getting the epoch.
---
thermometer/thermometer.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/thermometer/thermometer.c b/thermometer/thermometer.c
index db33cdb..e3872c9 100644
--- a/thermometer/thermometer.c
+++ b/thermometer/thermometer.c
@@ -954,7 +954,7 @@ static void proc_measurement(struct thermometer *t, const uint8_t *pdu,
}
ts.tm_year = att_get_u16(&pdu[8]) - 1900;
- ts.tm_mon = pdu[10];
+ ts.tm_mon = pdu[10] - 1;
ts.tm_mday = pdu[11];
ts.tm_hour = pdu[12];
ts.tm_min = pdu[13];
--
1.7.7.4
next reply other threads:[~2011-11-25 15:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-25 15:37 Santiago Carot-Nemesio [this message]
2011-12-08 12:37 ` [PATCH] Fix bad epoch time stamp generation Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1322235448-9638-1-git-send-email-sancane@gmail.com \
--to=sancane@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).