From 94e2063ed5bda15fad8b81bf5acae42d8684de59 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 16 Jan 2017 14:09:42 +0000 Subject: add missing endian swap on year --- src/twa_t.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/twa_t.c b/src/twa_t.c index cfebb96..2001586 100644 --- a/src/twa_t.c +++ b/src/twa_t.c @@ -18,7 +18,7 @@ tw_dt_to_tm (TW_DateTime * tw_dt, struct tm *tm) tm->tm_hour = tw_dt->tw_hour; tm->tm_mday = tw_dt->tw_day; tm->tm_mon = tw_dt->tw_month - 1; - tm->tm_year = tw_dt->tw_year - 1900; + tm->tm_year = le16_to_cpu(tw_dt->tw_year - 1900); } @@ -33,7 +33,7 @@ tm_to_tw_dt (struct tm *tm, TW_DateTime * tw_dt) tw_dt->tw_hour = tm->tm_hour; tw_dt->tw_day = tm->tm_mday; tw_dt->tw_month = tm->tm_mon + 1; - tw_dt->tw_year = tm->tm_year + 1900; + tw_dt->tw_year = cpu_to_le16(tm->tm_year + 1900); } -- cgit v1.2.3