summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sax/source/tools/converter.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index 3ebe40cd1598..fda7cb48700f 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -1123,8 +1123,8 @@ bool Converter::convertDuration(util::Duration& rDuration,
if (-1 != nTemp)
{
nNanoSeconds = nTemp;
- sal_Int32 nDigits = nPos - nStart;
- assert(nDigits >= 0 && nDigits <= 9);
+ sal_Int32 nDigits = std::min<sal_Int32>(nPos - nStart, 9);
+ assert(nDigits >= 0);
for (; nDigits < 9; ++nDigits)
{
nNanoSeconds *= 10;