Fix valgrind warnings in trendlog functions (#226)

mktime requires the structure passed must be fully initialised:
https://en.cppreference.com/w/c/chrono/mktime#Notes
This commit is contained in:
Alexander Wells
2022-02-18 17:36:45 +00:00
committed by GitHub
parent f191ca1a96
commit d3e2a0d33f
+2 -2
View File
@@ -147,7 +147,7 @@ void Trend_Log_Init(void)
static bool initialized = false; static bool initialized = false;
int iLog; int iLog;
int iEntry; int iEntry;
struct tm TempTime; struct tm TempTime = {0};
time_t tClock; time_t tClock;
if (!initialized) { if (!initialized) {
@@ -924,7 +924,7 @@ bool TL_Is_Enabled(int iLog)
time_t TL_BAC_Time_To_Local(BACNET_DATE_TIME *SourceTime) time_t TL_BAC_Time_To_Local(BACNET_DATE_TIME *SourceTime)
{ {
struct tm LocalTime; struct tm LocalTime = {0};
int iTemp; int iTemp;
LocalTime.tm_year = LocalTime.tm_year =