summaryrefslogtreecommitdiff
path: root/indra/newview/lldateutil.cpp
diff options
context:
space:
mode:
authorrichard <none@none>2010-01-06 12:40:44 -0800
committerrichard <none@none>2010-01-06 12:40:44 -0800
commita1e342b3f711c7ea23ac60b016c8b4024bf18a4a (patch)
treedb8811781e59231e3cba9f5058adbe72cec64aa7 /indra/newview/lldateutil.cpp
parent7586d8fcfde811cb04fb1c95aa0aa235b8df6aff (diff)
parent49660730308fb6d5301d1617402a353a21e9d9be (diff)
merge
Diffstat (limited to 'indra/newview/lldateutil.cpp')
-rw-r--r--indra/newview/lldateutil.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/newview/lldateutil.cpp b/indra/newview/lldateutil.cpp
index 10b7935caf..abb2fdeb9a 100644
--- a/indra/newview/lldateutil.cpp
+++ b/indra/newview/lldateutil.cpp
@@ -44,15 +44,18 @@ static S32 DAYS_PER_MONTH_LEAP[] =
static S32 days_from_month(S32 year, S32 month)
{
+ llassert_always(1 <= month);
+ llassert_always(month <= 12);
+
if (year % 4 == 0
&& year % 100 != 0)
{
// leap year
- return DAYS_PER_MONTH_LEAP[month];
+ return DAYS_PER_MONTH_LEAP[month - 1];
}
else
{
- return DAYS_PER_MONTH_NOLEAP[month];
+ return DAYS_PER_MONTH_NOLEAP[month - 1];
}
}