From a5dcb137d79e05cfdde85a3a5086a9f7d4cad8f5 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sat, 5 Jun 2010 09:55:45 +0000 Subject: [PATCH] The month was always one too far in time in incoming messages --- src/gsm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gsm.c b/src/gsm.c index 65d264d..bcbd36c 100644 --- a/src/gsm.c +++ b/src/gsm.c @@ -1710,6 +1710,8 @@ static time_t _cmgr_pdu_parse_timestamp(char const * timestamp) t.tm_year = (p[0] - '0') + ((p[1] - '0') * 10); t.tm_year = (t.tm_year > 70) ? t.tm_year : (100 + t.tm_year); t.tm_mon = (p[2] - '0') + ((p[3] - '0') * 10); + if(t.tm_mon > 0) + t.tm_mon--; t.tm_mday = (p[4] - '0') + ((p[5] - '0') * 10); t.tm_hour = (p[6] - '0') + ((p[7] - '0') * 10); t.tm_min = (p[8] - '0') + ((p[9] - '0') * 10);