-- 
Regards,
Alexander Chemeris.
CEO, Fairwaves, Inc. / ООО УмРадио
https://fairwaves.co
From c73e793eda7b0961f83956fd4ed2aac378a0869e Mon Sep 17 00:00:00 2001
From: Alexander Chemeris <[email protected]>
Date: Fri, 7 Mar 2014 21:00:19 +0100
Subject: [PATCH 4/6] sms: Add missing brackets in the relative validity time
 calculation.

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

diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c
index 1a6862b..6272ba3 100644
--- a/src/gsm/gsm0411_utils.c
+++ b/src/gsm/gsm0411_utils.c
@@ -137,13 +137,13 @@ static unsigned long gsm340_vp_relative(time_t now, uint8_t *sms_vp)
 
 	vp = *(sms_vp);
 	if (vp <= 143)
-		minutes = vp + 1 * 5;
+		minutes = (vp + 1) * 5;
 	else if (vp <= 167)
 		minutes = 12*60 + (vp-143) * 30;
 	else if (vp <= 196)
-		minutes = vp-166 * 60 * 24;
+		minutes = (vp-166) * 60 * 24;
 	else
-		minutes = vp-192 * 60 * 24 * 7;
+		minutes = (vp-192) * 60 * 24 * 7;
 
 	/* Calculate absolute time from the relative offset */
 	return now + minutes * 60;
-- 
1.7.9.5

Reply via email to