aboutsummaryrefslogtreecommitdiffstats
path: root/uemis-downloader.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-23 11:55:29 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-23 11:57:00 -0800
commit3e5a508b15fe28083dfdf5a049d33e8769616395 (patch)
tree2988b0075a67d1748b28bbe3df5e88e03ac08ae9 /uemis-downloader.c
parentb1db60ba4795638192c0dea93670d858d4178528 (diff)
downloadsubsurface-3e5a508b15fe28083dfdf5a049d33e8769616395.tar.gz
Ensure each dive has its own copy of the location text (UEMIS importer)
Since multiple dives can reference the same divesite we need to do the strdup when the value gets assigned, not when it gets passed into the helper function. This also validates the location string as on my divecomputer there is an invalid divespot 0 that has a corrupted UTF8 string as location name. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r--uemis-downloader.c2
1 files changed, 1 insertions, 1 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)