From f1ccd435d4e4c8a1e3136cb6386836e5faeff222 Mon Sep 17 00:00:00 2001 From: Michal Fratczak Date: Sun, 21 Jan 2024 23:10:19 +0100 Subject: [PATCH] fix bug in parsing negativelat/lon --- code/common/sentence_parse.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/common/sentence_parse.cpp b/code/common/sentence_parse.cpp index 460526b..93a294e 100644 --- a/code/common/sentence_parse.cpp +++ b/code/common/sentence_parse.cpp @@ -117,10 +117,10 @@ float parse_gps_pos(const std::string lat_or_lon) } //check if this NMEA DDMM.MMMM or usual decimal DD.DDDD - size_t decimal_pos = coord.find('.'); + const size_t decimal_pos = coord.find('.'); if(decimal_pos == 2 || decimal_pos == 3) - return stof(coord); // usual decimal + return stof(lat_or_lon); // usual decimal // this is NMEA format if(decimal_pos == 4) { // latitude