From aac8a4c3c46997bc19b61da38c24e92000d15119 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Wed, 7 Sep 2011 21:31:06 +0000 Subject: [PATCH] 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 --- src/kits/support/DateTime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kits/support/DateTime.cpp b/src/kits/support/DateTime.cpp index 8fd64320b1..0d7c197255 100644 --- a/src/kits/support/DateTime.cpp +++ b/src/kits/support/DateTime.cpp @@ -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)); } }