From a6336d13b302d071bc94cc15b4a865f0ba2492f7 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 12 Feb 2015 12:27:55 -0800 Subject: [PATCH] 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 --- divesite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/divesite.c b/divesite.c index c3bb45950..c9dbb095a 100644 --- a/divesite.c +++ b/divesite.c @@ -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;