From d00be63c86bae3579e9cdd5e523e09146b72dc22 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 5 Dec 2012 11:54:15 -0800 Subject: 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 --- uemis-downloader.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'uemis-downloader.c') 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); -- cgit v1.2.3-70-g09d2