mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Uemis downloader: bug fix in uemis set dive location
Assuring that ds isn't NULL, had a few cases that made SubSurface crash. Have not investigated the root cause but it's likely that it is related to the Uemis specific code. Nevertheless, checking ds non NULL is certainly not a bad thing to do. Signed-off-by: glerch <guido.lerch@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
dc02a7aa6d
commit
682e23775c
1 changed files with 5 additions and 3 deletions
2
uemis.c
2
uemis.c
|
@ -173,10 +173,12 @@ void uemis_set_divelocation(int divespot, char *text, double longitude, double l
|
|||
while (hp) {
|
||||
if (hp->divespot == divespot) {
|
||||
struct dive_site *ds = get_dive_site_by_uuid(hp->dive_site_uuid);
|
||||
if (ds) {
|
||||
ds->name = strdup(text);
|
||||
ds->longitude.udeg = round(longitude * 1000000);
|
||||
ds->latitude.udeg = round(latitude * 1000000);
|
||||
}
|
||||
}
|
||||
hp = hp->next;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue