[PATCH] smsd sqlite insert month number correctly
Pedro Aguilar <[email protected]> Tue, 20 May 2014 11:54:01 +0200 (CEST)
| Newsgroups | gmane.linux.drivers.gnokii |
|---|---|
| Message-ID | <[email protected]> |
Hi, The following simple patch fixes the month number in SQLite's inbox table. Since localtime() returns tm_mon in the range 0 -11, by adding one it inserts the right month. Regards, Pedro Aguilar http://paguilar.org _______________________________________________ gnokii-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/gnokii-users
insert_right_month_number.patch
(text/x-patch, 561 B)
--- a/smsd/sqlite.c 2014-02-06 16:38:22.642678584 +0100
+++ b/smsd/sqlite.c 2014-05-20 11:41:12.544213896 +0200
@@ -89,7 +96,7 @@
data->smsc_time.year, data->smsc_time.month,
data->smsc_time.day, data->smsc_time.hour,
data->smsc_time.minute, data->smsc_time.second,
- timeinfo->tm_year + 1900, timeinfo->tm_mon,
+ timeinfo->tm_year + 1900, timeinfo->tm_mon + 1,
timeinfo->tm_mday, timeinfo->tm_hour,
timeinfo->tm_min, timeinfo->tm_sec,
text->str, phnStr->str);