[FIX 1/2] fixup! sms: Fix gsm340_scts() to correctly decode absolute valid times.

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Daniel Willmann dwillmann at sysmocom.de
Wed Mar 26 21:44:42 UTC 2014


---
 src/gsm/gsm0411_utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c
index 197f2c3..3052dd7 100644
--- a/src/gsm/gsm0411_utils.c
+++ b/src/gsm/gsm0411_utils.c
@@ -120,8 +120,8 @@ time_t gsm340_scts(uint8_t *scts)
 	/* according to gsm 03.40 time zone is
 	   "expressed in quarters of an hour" */
 	tz = *scts++;
-	ofs = gsm411_unbcdify(tz&0x7f) * 15*60;
-	if (tz&0x80)
+	ofs = gsm411_unbcdify(tz&0xf7) * 15*60;
+	if (tz&0x08)
 		ofs = -ofs;
 	/* mktime() doesn't take tm.tm_gmtoff into account. Instead, it fills this
 	 * field with the current timezone. Which means that the resulting time is
-- 
1.8.4.2





More information about the OpenBSC mailing list