summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-12-17 17:20:42 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-12-17 17:20:42 +0100
commit71448690d7c5904df45bf98243c5bb05a99245e5 (patch)
treebbf8eea2fbcf187fb25ecfce6179d3ce05201c12 /sax
parentacb9da3d4a0d04be447d942da2ea197aa12349e3 (diff)
readUnsignedNumberMaxDigits can read more than maxDigits chars
...so that is what the std::min was good for that the previous commit erroneously removed. Change-Id: I0cb08ab79f85ce4b919232845994c9b8bae35646
Diffstat (limited to 'sax')
-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;