summaryrefslogtreecommitdiffstats
path: root/uemis-downloader.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-05 11:54:15 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-05 11:54:15 -0800
commitd00be63c86bae3579e9cdd5e523e09146b72dc22 (patch)
tree2bdc5b26ad43a822ed7346eb32fc3cf48eadf1cf /uemis-downloader.c
parent5e5e3460acf9d29b03aff71228aff01e31a3bf45 (diff)
downloadsubsurface-d00be63c86bae3579e9cdd5e523e09146b72dc22.tar.gz
Change Uemis code to use locale indepent floating point parsing
I clearly forgot about not using atof... now we use the locale safe g_ascii_strtod instead. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r--uemis-downloader.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c
index 8f4ceaf2e..b7ae0bedf 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -92,7 +92,7 @@ static void uemis_ts(char *buffer, void *_when)
/* float minutes */
static void uemis_duration(char *buffer, duration_t *duration)
{
- duration->seconds = atof(buffer) * 60 + 0.5;
+ duration->seconds = g_ascii_strtod(buffer, NULL) * 60 + 0.5;
}
/* int cm */
@@ -127,7 +127,7 @@ static void uemis_add_string(char *buffer, char **text)
static void uemis_get_weight(char *buffer, weightsystem_t *weight, int diveid)
{
weight->weight.grams = uemis_get_weight_unit(diveid) ?
- lbs_to_grams(atof(buffer)) : atof(buffer) * 1000;
+ lbs_to_grams(g_ascii_strtod(buffer, NULL)) : g_ascii_strtod(buffer, NULL) * 1000;
weight->description = strdup("unknown");
}
@@ -545,9 +545,9 @@ static void parse_divespot(char *buf)
"%s%s", len ? ", " : "", val);
} else if (!strcmp(type, "float")) {
if (!strcmp(tag, "longitude"))
- longitude = atof(val);
+ longitude = g_ascii_strtod(val, NULL);
else if (!strcmp(tag, "latitude"))
- latitude = atof(val);
+ latitude = g_ascii_strtod(val, NULL);
}
} while (tag && *tag);
uemis_set_divelocation(divespot, strdup(locationstring), latitude, longitude);