1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-24 05:53:16 +00:00

ensure that an index cannot be negative

This commit is contained in:
Carles Fernandez 2015-05-29 18:45:39 +02:00
parent 4fe35f760b
commit f243455c18

View File

@ -530,8 +530,8 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr,
{
redoexp = true;
// Swap digit and decimal.
aStr[idx] = aStr[idx - 1];
aStr[idx - 1] = '.';
aStr[static_cast<unsigned int>(idx)] = aStr[static_cast<unsigned int>(idx - 1)];
aStr[static_cast<unsigned int>(idx - 1)] = '.';
// Only add one to the exponent if the number is non-zero
if (asDouble(aStr.substr(startPos, length)) != 0.0)
expAdd = 1;