[PATCH] Fix bad epoch time stamp generation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux