linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix bad epoch time stamp generation
@ 2011-11-25 15:37 Santiago Carot-Nemesio
  2011-12-08 12:37 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Santiago Carot-Nemesio @ 2011-11-25 15:37 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Santiago Carot-Nemesio

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-08 12:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-25 15:37 [PATCH] Fix bad epoch time stamp generation Santiago Carot-Nemesio
2011-12-08 12:37 ` Johan Hedberg

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