aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@artemis.panaceas.org>2017-01-16 14:09:42 +0000
committerroot <root@artemis.panaceas.org>2017-01-16 14:09:42 +0000
commit94e2063ed5bda15fad8b81bf5acae42d8684de59 (patch)
tree28f5a3a849252e303ff71ae9e93f08c0feb33489
parent71a5a65d090cd71cabfb3fc94209d621d5a9fd0b (diff)
downloadtwa_t-master.tar.gz
twa_t-master.tar.bz2
twa_t-master.zip
add missing endian swap on yearHEADmaster
-rw-r--r--src/twa_t.c4
1 files 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);
}