mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-13 19:50:34 +00:00
ensure that an index cannot be negative
This commit is contained in:
parent
4fe35f760b
commit
f243455c18
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user