diff options
-rw-r--r-- | svl/source/numbers/zformat.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index a1d55cbc82f9..c9bd3d814e90 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -3075,7 +3075,7 @@ bool SvNumberformat::ImpGetTimeOutput(double fNumber, (rInfo.nTypeArray[i-1] == NF_SYMBOLTYPE_STRING || rInfo.nTypeArray[i-1] == NF_SYMBOLTYPE_TIME100SECSEP) ? nCntPost : rInfo.sStrArray[i].getLength() ); - for (sal_Int32 j = 0; j < nLen && nSecPos < nCntPost; j++) + for (sal_Int32 j = 0; j < nLen && nSecPos < nCntPost && nSecPos < sSecStr.getLength(); ++j) { sBuff.append(sSecStr[nSecPos]); nSecPos++; @@ -3955,7 +3955,7 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber, (rInfo.nTypeArray[i-1] == NF_SYMBOLTYPE_STRING || rInfo.nTypeArray[i-1] == NF_SYMBOLTYPE_TIME100SECSEP) ? nCntPost : rInfo.sStrArray[i].getLength() ); - for (sal_Int32 j = 0; j < nLen && nSecPos < nCntPost; j++) + for (sal_Int32 j = 0; j < nLen && nSecPos < nCntPost && nSecPos < sSecStr.getLength(); ++j) { sBuff.append(sSecStr[ nSecPos ]); nSecPos++; |