Fix clamping in BDate::AddMonths():
* use _DaysInMonth() instead of DaysInMonth(), as the latter only works for valid dates, which we do not have if the day needs to be clamped to the maximum value for the current month git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42719 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -721,7 +721,7 @@ BDate::AddMonths(int32 months)
|
||||
if (fYear == 1582 && fMonth == 10 && fDay > 4 && fDay < 15)
|
||||
fDay = (months > 0) ? 15 : 4;
|
||||
|
||||
fDay = min_c(fDay, DaysInMonth());
|
||||
fDay = min_c(fDay, _DaysInMonth(fYear, fMonth));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user