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
This commit is contained in:
Stephan Bergmann
2013-12-17 17:20:42 +01:00
parent acb9da3d4a
commit 71448690d7

View File

@@ -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;