Skip to content

Commit 0427bb7

Browse files
authored
Merge pull request #11396 from gpsimenos/remove-sms-floats
Remove floating point from AT_CellularSMS
2 parents b8ebee5 + 93cebc1 commit 0427bb7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

features/cellular/framework/AT/AT_CellularSMS.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ int AT_CellularSMS::compare_time_strings(const char *time_string_1, const char *
11141114
int retVal = -2;
11151115

11161116
if (success) {
1117-
double diff = difftime(t1, t2);
1117+
time_t diff = t1 - t2;
11181118

11191119
if (diff > 0) {
11201120
retVal = 1;
@@ -1140,7 +1140,7 @@ bool AT_CellularSMS::create_time(const char *time_string, time_t *time)
11401140
&time_struct.tm_hour, &time_struct.tm_min, &time_struct.tm_sec, &sign, &gmt) == kNumberOfElements) {
11411141
*time = mktime(&time_struct);
11421142
// add timezone as seconds. gmt is in quarter of hours.
1143-
int x = 60 * 60 * gmt * 0.25;
1143+
int x = (60 / 4) * 60 * gmt;
11441144
if (sign == '+') {
11451145
*time += x;
11461146
} else {

0 commit comments

Comments
 (0)