From dac29e7bc4e417d0fcdac0246a1b534eb704bf85 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 8 Mar 2013 09:57:53 -0800 Subject: Never use localized floating point numbers The GPS entry incorrectly used strtod Signed-off-by: Dirk Hohndel --- info.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'info.c') 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; -- cgit v1.2.3-70-g09d2