diff options
author | Eike Rathke <erack@redhat.com> | 2017-05-02 22:32:39 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-05-02 23:12:34 +0200 |
commit | eace834d0830bbf4c89f7f5ea8666fb91527e466 (patch) | |
tree | 64e268a88a753eea650246c5a61e5c5088b43aca /tools | |
parent | 9daa6e293d24694cb6102a15f228a6c008acf79d (diff) |
Assert that nMonth and nDay <100 to be representable
Change-Id: Ie52269478ecac75519d04310a17873904c8167e6
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/datetime/tdate.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx index 3dd8f68b3ced..06c1d0e24454 100644 --- a/tools/source/datetime/tdate.cxx +++ b/tools/source/datetime/tdate.cxx @@ -104,6 +104,8 @@ inline sal_uInt16 ImplDaysInMonth( sal_uInt16 nMonth, sal_Int16 nYear ) void Date::setDateFromDMY( sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear ) { SAL_WARN_IF( nYear == 0, "tools.datetime", "Date::setDateFromDMY - sure about 0 year? It's not in the calendar."); + assert( nMonth < 100 && "nMonth % 100 not representable" ); + assert( nDay < 100 && "nDay % 100 not representable" ); if (nYear < 0) mnDate = (static_cast<sal_Int32>( nYear ) * 10000) - |