Don't ever create a dive site without valid uuid

If you want a specific one, you can always overwrite it, but a dive site
with a uuid of 0 breaks some of our assumptions.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-02-12 12:27:55 -08:00
parent 0e6345f65b
commit a6336d13b3

View file

@ -33,6 +33,7 @@ struct dive_site *alloc_dive_site()
exit(1);
sites[nr] = ds;
dive_site_table.nr = nr + 1;
ds->uuid = dive_site_getUniqId();
return ds;
}
@ -40,7 +41,6 @@ struct dive_site *alloc_dive_site()
uint32_t create_dive_site(const char *name)
{
struct dive_site *ds = alloc_dive_site();
ds->uuid = dive_site_getUniqId();
ds->name = copy_string(name);
return ds->uuid;