diff options
Diffstat (limited to 'core/liquivision.c')
-rw-r--r-- | core/liquivision.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/core/liquivision.c b/core/liquivision.c index 019f7613c..bfe970e15 100644 --- a/core/liquivision.c +++ b/core/liquivision.c @@ -143,7 +143,6 @@ static void parse_dives(int log_version, const unsigned char *buf, unsigned int while (ptr < buf_size) { int i; - bool found_divesite = false; dive = alloc_dive(); memset(&sensor_ids, 0, sizeof(sensor_ids)); dc = &dive->dc; @@ -191,8 +190,10 @@ static void parse_dives(int log_version, const unsigned char *buf, unsigned int } /* Store the location only if we have one */ - if (len || place_len) - found_divesite = true; + if (len || place_len) { + dive->dive_site = find_or_create_dive_site_with_name(location, sites); + free(location); + } ptr += len + 4 + place_len; @@ -224,12 +225,6 @@ static void parse_dives(int log_version, const unsigned char *buf, unsigned int dive->when = array_uint32_le(buf + ptr); ptr += 4; - // now that we have the dive time we can store the divesite - // (we need the dive time to create deterministic uuids) - if (found_divesite) { - dive->dive_site = find_or_create_dive_site_with_name(location, dive->when, sites); - free(location); - } //unsigned int end_time = array_uint32_le(buf + ptr); ptr += 4; |