don't crash in GetAsDOS() if the time is not in time_t range (bug 1804421)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@49000 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-09-30 20:37:29 +00:00
parent 7daa1d24b7
commit f9d8aad8f4

View File

@@ -1609,6 +1609,7 @@ unsigned long wxDateTime::GetAsDOS() const
time_t ticks = GetTicks(); time_t ticks = GetTicks();
struct tm tmstruct; struct tm tmstruct;
struct tm *tm = wxLocaltime_r(&ticks, &tmstruct); struct tm *tm = wxLocaltime_r(&ticks, &tmstruct);
wxCHECK_MSG( tm, ULONG_MAX, _T("time can't be represented in DOS format") );
long year = tm->tm_year; long year = tm->tm_year;
year -= 80; year -= 80;