X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/770882a69e30385237f89d467972775199e4f546..c0bf294f24c6d5a48249b2e1986dd707133c447f:/src/common/datetime.cpp?ds=sidebyside diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 087db34e89..c80eddf67d 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -1607,6 +1607,7 @@ unsigned long wxDateTime::GetAsDOS() const time_t ticks = GetTicks(); struct tm 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; year -= 80; @@ -3962,8 +3963,8 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date) } else // not a valid month name { - wday = GetWeekDayFromName(token, Name_Full | Name_Abbr); - if ( wday != Inv_WeekDay ) + WeekDay wday2 = GetWeekDayFromName(token, Name_Full | Name_Abbr); + if ( wday2 != Inv_WeekDay ) { // a week day if ( haveWDay ) @@ -3971,6 +3972,8 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date) break; } + wday = wday2; + haveWDay = true; } else // not a valid weekday name