When determining if a day is valid, get_day_num() (in
util.cpp) uses 'month' as an index into monthlength
and/or monthlenghthleap. 'month' has a range of 1..12,
but the valid index values for monthlength begin at 0,
making January = 0 and December = 11.
The bug is probably only obvious when a date entered has
a month of December, which fails (assuming
monthlength == 0, which probably isn't always the
case) due to the out of range index.
I'm attaching a patch to util.cpp that changes the index
values from 'month' to 'month-1'. It seems to work,
though I haven't looked to see if a similar change would
be needed elsewhere is the program.
Hope this helps.