Skip to content

Commit

Permalink
AP_Periph: use gmtime_r() instead of gmtime()
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Feb 21, 2024
1 parent 3d4dbd0 commit 20cb709
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Tools/AP_Periph/msp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ void AP_Periph_FW::send_msp_GPS(void)
}
uint64_t tepoch_us = gps.time_epoch_usec(0);
time_t utc_sec = tepoch_us / (1000U * 1000U);
struct tm* tm = gmtime(&utc_sec);
struct tm tvd {};
struct tm* tm = gmtime_r(&utc_sec, &tvd);

p.year = tm->tm_year+1900;
p.month = tm->tm_mon;
Expand Down

0 comments on commit 20cb709

Please sign in to comment.