[Libreoffice-commits] core.git: basic/source
Eike Rathke
erack at redhat.com
Fri Apr 28 22:23:42 UTC 2017
basic/source/runtime/methods.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 38d9919432898c114d38022c2eb0d9fa9fea948c
Author: Eike Rathke <erack at redhat.com>
Date: Fri Apr 28 22:12:31 2017 +0200
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
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index f4e60a51b2ca..82bd2ce03134 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -2031,7 +2031,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 ),
More information about the Libreoffice-commits
mailing list