aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-03-08 09:57:53 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-03-08 09:57:53 -0800
commitdac29e7bc4e417d0fcdac0246a1b534eb704bf85 (patch)
tree10c14877ba4f349d7440f96cac10b34f0fbcb04c
parentf1f667c96f6c646bb48dcd4c306d13522ce0c34e (diff)
downloadsubsurface-dac29e7bc4.tar.gz
Never use localized floating point numbers
The GPS entry incorrectly used strtod Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--info.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/info.c b/info.c
index 4a4b41c7d..813608115 100644
--- a/info.c
+++ b/info.c
@@ -427,7 +427,7 @@ static gboolean parse_gps_text(const char *gps_text, double *latitude, double *l
text += incr;
south = TRUE;
}
- parselat = strtod(text, &endptr);
+ parselat = g_ascii_strtod(text, &endptr);
if (text == endptr)
return FALSE;
text = endptr;
@@ -441,7 +441,7 @@ static gboolean parse_gps_text(const char *gps_text, double *latitude, double *l
text = g_utf8_next_char(text);
incr = string_advance_cardinal(text, "E") + string_advance_cardinal(text, "W");
if (!incr && c != ';' && c != ',') {
- parselat += strtod(text, &endptr) / 60.0;
+ parselat += g_ascii_strtod(text, &endptr) / 60.0;
if (text == endptr)
return FALSE;
text = endptr;
@@ -459,7 +459,7 @@ static gboolean parse_gps_text(const char *gps_text, double *latitude, double *l
text += incr;
west = TRUE;
}
- parselong = strtod(text, &endptr);
+ parselong = g_ascii_strtod(text, &endptr);
if (text == endptr)
return FALSE;
text = endptr;
@@ -472,7 +472,7 @@ static gboolean parse_gps_text(const char *gps_text, double *latitude, double *l
while (g_unichar_isspace(c = g_utf8_get_char(text)) || c == degrees)
text = g_utf8_next_char(text);
if (*text) {
- parselong += strtod(text, &endptr) / 60.0;
+ parselong += g_ascii_strtod(text, &endptr) / 60.0;
if (text == endptr)
return FALSE;
text = endptr;