Skip to content

Commit

Permalink
Avoid potential overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gpsimenos committed Sep 2, 2019
1 parent 4df7044 commit 93cebc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion features/cellular/framework/AT/AT_CellularSMS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ bool AT_CellularSMS::create_time(const char *time_string, time_t *time)
&time_struct.tm_hour, &time_struct.tm_min, &time_struct.tm_sec, &sign, &gmt) == kNumberOfElements) {
*time = mktime(&time_struct);
// add timezone as seconds. gmt is in quarter of hours.
int x = (60 * 60 * gmt) / 4;
int x = (60 / 4) * 60 * gmt;
if (sign == '+') {
*time += x;
} else {
Expand Down

0 comments on commit 93cebc1

Please sign in to comment.