Skip to content
Snippets Groups Projects
Commit ae608e6e authored by Esme Povirk's avatar Esme Povirk Committed by Alexandre Julliard
Browse files

comctl32: Validate the day of month when scrolling through years.

parent 0d8775c9
Branches
Tags
No related merge requests found
......@@ -474,6 +474,9 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number, int delta)
case TWODIGITYEAR:
case FULLYEAR:
date->wYear = wrap(date->wYear, delta, 1752, 9999);
if (date->wDay > MONTHCAL_MonthLength(date->wMonth, date->wYear))
/* This can happen when moving away from a leap year. */
date->wDay = MONTHCAL_MonthLength(date->wMonth, date->wYear);
MONTHCAL_CalculateDayOfWeek(date, TRUE);
break;
case ONEDIGITMONTH:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment