aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2014-03-07 21:00:19 +0100
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2014-03-16 15:08:54 +0400
commit36d0feee3abdd6c8d2f645c11e026fcf828224ea (patch)
tree0081276e5f8c634cf763e42102291a09dd94c345
parent93d9a19d6751ee69d3e5c134ffe35519e1b4049b (diff)
sms: Add missing brackets in the relative validity time calculation.
-rw-r--r--src/gsm/gsm0411_utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c
index e0908efe..b4b51163 100644
--- a/src/gsm/gsm0411_utils.c
+++ b/src/gsm/gsm0411_utils.c
@@ -132,13 +132,13 @@ static time_t gsm340_vp_relative(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;
/* Convert to seconds */
return minutes * 60;