summaryrefslogtreecommitdiff
path: root/indra/newview/lldateutil.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-01-07 16:20:27 -0500
committerLoren Shih <seraph@lindenlab.com>2010-01-07 16:20:27 -0500
commit6abd41831a4cae5d757aa44675731d1fd48d64b1 (patch)
tree6fc9de74e865a8337823b317a87b7c132bca0c7a /indra/newview/lldateutil.cpp
parentbb04795eeb222e5396e24e79ac1f77b155bd4622 (diff)
parent6b8ed2ae6f92d6f9559cbc86699b9ca3197f2e81 (diff)
automated merge viewer2.0->viewer2.0
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];
}
}