summaryrefslogtreecommitdiffstats
path: root/uemis.c
diff options
context:
space:
mode:
Diffstat (limited to 'uemis.c')
-rw-r--r--uemis.c4
1 files changed, 3 insertions, 1 deletions
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);
}