summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--uemis-downloader.c2
-rw-r--r--uemis.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c
index 4a9f4272b..631bb23f1 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -575,7 +575,7 @@ static void parse_divespot(char *buf)
latitude = g_ascii_strtod(val, NULL);
}
} while (tag && *tag);
- uemis_set_divelocation(divespot, strdup(locationstring), latitude, longitude);
+ uemis_set_divelocation(divespot, locationstring, latitude, longitude);
}
static void track_divespot(char *val, int diveid, char **location, degrees_t *latitude, degrees_t *longitude)
diff --git a/uemis.c b/uemis.c
index d323cd802..29913ca0d 100644
--- a/uemis.c
+++ b/uemis.c
@@ -166,9 +166,11 @@ void uemis_mark_divelocation(int diveid, int divespot, char **location, degrees_
void uemis_set_divelocation(int divespot, char *text, double longitude, double latitude)
{
struct uemis_helper *hp = uemis_helper;
+ if (!g_utf8_validate(text, -1, NULL))
+ return;
while (hp) {
if (hp->divespot == divespot && hp->location) {
- *hp->location = text;
+ *hp->location = strdup(text);
hp->longitude->udeg = round(longitude * 1000000);
hp->latitude->udeg = round(latitude * 1000000);
}