Chaned Time without Format= to return timestamp instead of empty string (%H:%M:%S was returned prior to 70117876)

This commit is contained in:
Birunthan Mohanathas 2012-04-07 17:42:39 +03:00
parent 56679f0922
commit 584c03d153

View File

@ -76,7 +76,7 @@ void CMeasureTime::TimeToString(WCHAR* buf, size_t bufLen, const WCHAR* format,
_CrtSetReportMode(_CRT_ASSERT, 0); _CrtSetReportMode(_CRT_ASSERT, 0);
errno = 0; errno = 0;
wcsftime(buf, bufLen, m_Format.c_str(), time); wcsftime(buf, bufLen, format, time);
if (errno == EINVAL) if (errno == EINVAL)
{ {
LogWithArgs(LOG_ERROR, L"Time: \"Format=%s\" invalid in [%s]", format, m_Name.c_str()); LogWithArgs(LOG_ERROR, L"Time: \"Format=%s\" invalid in [%s]", format, m_Name.c_str());
@ -201,13 +201,13 @@ const WCHAR* CMeasureTime::GetStringValue(AUTOSCALE autoScale, double scale, int
{ {
TimeToString(tmpSz, MAX_LINE_LENGTH, format, &today); TimeToString(tmpSz, MAX_LINE_LENGTH, format, &today);
} }
return CheckSubstitute(tmpSz);
} }
else else
{ {
TimeToString(tmpSz, MAX_LINE_LENGTH, L"%H:%M:%S", &today); return CMeasure::GetStringValue(autoScale, scale, decimals, percentual);
} }
return CheckSubstitute(tmpSz);
} }
/* /*