From 485c610f226c4ae188fe87a01908ef5e5ddac919 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 23 May 2015 09:32:08 +0200 Subject: [PATCH] fixing error handling issue --- src/algorithms/PVT/libs/rinex_printer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index 585f6f463..a7573ffb6 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -513,7 +513,7 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr, long iexp; //If checkSwitch is false, always redo the exponential. Otherwise, //set it to false. - bool redoexp=!checkSwitch; + bool redoexp =! checkSwitch; // Check for decimal place within specified boundaries if ((idx == 0) || (idx >= (startPos + length - expLen - 1))) @@ -526,12 +526,12 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr, // account for the possibility of non-scientific // notation (more than one digit to the left of the // decimal) - if (idx > startPos) + if ((idx > startPos) && (idx >= 1)) { redoexp = true; // Swap digit and decimal. - aStr[idx] = aStr[idx-1]; - aStr[idx-1] = '.'; + aStr[idx] = aStr[idx - 1]; + aStr[idx - 1] = '.'; // Only add one to the exponent if the number is non-zero if (asDouble(aStr.substr(startPos, length)) != 0.0) expAdd = 1;