Use gmtime_r function to avoid UTC time corruption.

The gmtime library function is outputting
corrupted UTC time as this function is
not thread safer.

CRs-Fixed: 2571035

Change-Id: Ieed088392e3094eb20fa9b526931a3a89d4f231c
This commit is contained in:
Santoshkumar Zalake 2019-11-21 10:49:19 +05:30
parent 3b3bcb1113
commit 97c612b5a0

View file

@ -1195,7 +1195,8 @@ void loc_nmea_generate_pos(const UlpLocation &location,
(location, locationExtended, systemInfo, utcPosTimestamp);
time_t utcTime(utcPosTimestamp/1000);
tm * pTm = gmtime(&utcTime);
struct tm result;
tm * pTm = gmtime_r(&utcTime, &result);
if (NULL == pTm) {
LOC_LOGE("gmtime failed");
return;