[hamradio-commits] [gnss-sdr] 131/251: fixing error handling issue
Carles Fernandez
carles_fernandez-guest at moszumanska.debian.org
Wed Sep 2 00:22:43 UTC 2015
This is an automated email from the git hooks/post-receive script.
carles_fernandez-guest pushed a commit to branch master
in repository gnss-sdr.
commit 485c610f226c4ae188fe87a01908ef5e5ddac919
Author: Carles Fernandez <carles.fernandez at gmail.com>
Date: Sat May 23 09:32:08 2015 +0200
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 585f6f4..a7573ff 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;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/gnss-sdr.git
More information about the pkg-hamradio-commits
mailing list