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:
Oliver Tappe
2011-09-07 21:31:06 +00:00
parent b5fc0237e1
commit aac8a4c3c4
+1 -1
View File
@@ -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));
}
}