summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-04-28 22:12:31 +0200
committerAndras Timar <andras.timar@collabora.com>2017-05-04 12:48:30 +0200
commitd738647d8a8f2245d559de567efaea7ef535479a (patch)
treee580c72dd8407b4e6d6ba35edfd57723fe1c635f /basic
parent81984688ef18450ffad016d68a9ed9c72fd1a477 (diff)
CDateToIso: larger buffer for possible year range
Theoretically tools::Date can hold five digits years and even negative, though Basic internally accepts only 100<=year<=9999. Might be that some date calculations may result in years out of those margins, so at least don't truncate those. Change-Id: I3c217cc42476ce1cf8f9046111a1281288dc5bb6 (cherry picked from commit 38d9919432898c114d38022c2eb0d9fa9fea948c) Reviewed-on: https://gerrit.libreoffice.org/37087 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 33ec6df9e7f8bf70c1c1c2fe5dd89ba37b57bae2)
Diffstat (limited to 'basic')
-rw-r--r--basic/source/runtime/methods.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index d93c95aade98..4ac3935885c7 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -2037,7 +2037,7 @@ RTLFUNC(CDateToIso)
{
double aDate = rPar.Get(1)->GetDate();
- char Buffer[9];
+ char Buffer[11];
snprintf( Buffer, sizeof( Buffer ), "%04d%02d%02d",
implGetDateYear( aDate ),
implGetDateMonth( aDate ),