Fix warning: missing initializer for member
This commit is contained in:
parent
1dd6e9c453
commit
678f165350
@ -82,7 +82,7 @@ uint16_t DevInfoParser::getFwBuildVersion()
|
|||||||
|
|
||||||
time_t DevInfoParser::getFwBuildDateTime()
|
time_t DevInfoParser::getFwBuildDateTime()
|
||||||
{
|
{
|
||||||
struct tm timeinfo = { 0 };
|
struct tm timeinfo = { };
|
||||||
timeinfo.tm_year = ((((uint16_t)_payloadDevInfoAll[2]) << 8) | _payloadDevInfoAll[3]) - 1900;
|
timeinfo.tm_year = ((((uint16_t)_payloadDevInfoAll[2]) << 8) | _payloadDevInfoAll[3]) - 1900;
|
||||||
|
|
||||||
timeinfo.tm_mon = ((((uint16_t)_payloadDevInfoAll[4]) << 8) | _payloadDevInfoAll[5]) / 100 - 1;
|
timeinfo.tm_mon = ((((uint16_t)_payloadDevInfoAll[4]) << 8) | _payloadDevInfoAll[5]) / 100 - 1;
|
||||||
|
|||||||
@ -258,7 +258,7 @@ void WebApiNtpClass::onNtpTimePost(AsyncWebServerRequest* request)
|
|||||||
local.tm_year = root[F("year")].as<uint>() - 1900; // years since 1900
|
local.tm_year = root[F("year")].as<uint>() - 1900; // years since 1900
|
||||||
|
|
||||||
time_t t = mktime(&local);
|
time_t t = mktime(&local);
|
||||||
struct timeval now = { .tv_sec = t };
|
struct timeval now = { .tv_sec = t, .tv_usec = 0 };
|
||||||
settimeofday(&now, NULL);
|
settimeofday(&now, NULL);
|
||||||
|
|
||||||
retMsg[F("type")] = F("success");
|
retMsg[F("type")] = F("success");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user