Skip to content

Commit 93cebc1

Browse files
committed
Avoid potential overflow
1 parent 4df7044 commit 93cebc1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

features/cellular/framework/AT/AT_CellularSMS.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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) / 4;
1143+
int x = (60 / 4) * 60 * gmt;
11441144
if (sign == '+') {
11451145
*time += x;
11461146
} else {

0 commit comments

Comments
 (0)