[Libreoffice-commits] core.git: sax/source

Stephan Bergmann sbergman at redhat.com
Tue Dec 17 08:21:17 PST 2013


 sax/source/tools/converter.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 71448690d7c5904df45bf98243c5bb05a99245e5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Dec 17 17:20:42 2013 +0100

    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

diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index 3ebe40c..fda7cb4 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;


More information about the Libreoffice-commits mailing list