mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
5e5e3460ac
commit
d00be63c86
1 changed files with 4 additions and 4 deletions
|
@ -92,7 +92,7 @@ static void uemis_ts(char *buffer, void *_when)
|
||||||
/* float minutes */
|
/* float minutes */
|
||||||
static void uemis_duration(char *buffer, duration_t *duration)
|
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 */
|
/* 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)
|
static void uemis_get_weight(char *buffer, weightsystem_t *weight, int diveid)
|
||||||
{
|
{
|
||||||
weight->weight.grams = uemis_get_weight_unit(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");
|
weight->description = strdup("unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -545,9 +545,9 @@ static void parse_divespot(char *buf)
|
||||||
"%s%s", len ? ", " : "", val);
|
"%s%s", len ? ", " : "", val);
|
||||||
} else if (!strcmp(type, "float")) {
|
} else if (!strcmp(type, "float")) {
|
||||||
if (!strcmp(tag, "longitude"))
|
if (!strcmp(tag, "longitude"))
|
||||||
longitude = atof(val);
|
longitude = g_ascii_strtod(val, NULL);
|
||||||
else if (!strcmp(tag, "latitude"))
|
else if (!strcmp(tag, "latitude"))
|
||||||
latitude = atof(val);
|
latitude = g_ascii_strtod(val, NULL);
|
||||||
}
|
}
|
||||||
} while (tag && *tag);
|
} while (tag && *tag);
|
||||||
uemis_set_divelocation(divespot, strdup(locationstring), latitude, longitude);
|
uemis_set_divelocation(divespot, strdup(locationstring), latitude, longitude);
|
||||||
|
|
Loading…
Add table
Reference in a new issue