From 6035571b96d9f7724f8cf4964eab5513e9d1e543 Mon Sep 17 00:00:00 2001 From: fwcd Date: Sat, 6 Apr 2019 23:00:11 +0200 Subject: [PATCH] Replace iterator in NumberToString with index (conv.cpp) --- src/CalcManager/Ratpack/conv.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CalcManager/Ratpack/conv.cpp b/src/CalcManager/Ratpack/conv.cpp index 0d7e3ee4..b4af9d38 100644 --- a/src/CalcManager/Ratpack/conv.cpp +++ b/src/CalcManager/Ratpack/conv.cpp @@ -1199,7 +1199,7 @@ wstring NumberToString(_Inout_ PNUMBER& pnum, int format, uint32_t radix, int32_ // Set up all the post rounding stuff. bool useSciForm = false; int32_t eout = exponent - 1; // Displayed exponent. - vector::iterator pmant = pnum->mant.begin() + pnum->cdigit - 1; + int32_t imant = pnum->cdigit - 1; // Case where too many digits are to the left of the decimal or // FMT_SCIENTIFIC or FMT_ENGINEERING was specified. if ((format == FMT_SCIENTIFIC) || (format == FMT_ENGINEERING)) @@ -1256,7 +1256,7 @@ wstring NumberToString(_Inout_ PNUMBER& pnum, int format, uint32_t radix, int32_ while (length > 0) { exponent--; - resultStream << DIGITS[*pmant--]; + resultStream << DIGITS[pnum->mant[imant--]]; length--; // Be more regular in using a decimal point.