X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=divelist.c;h=e994b32527d1dd2289259b5f489052fd8303971e;hb=307240d6f6fefa83618e8c271203bc57df1081c7;hp=ce61d20d16d75fd835a8f0777bd2685dac998763;hpb=19621bf481c68955184c11dd407c59af4a05130e;p=ext%2Fsubsurface.git diff --git a/divelist.c b/divelist.c index ce61d20..e994b32 100644 --- a/divelist.c +++ b/divelist.c @@ -294,7 +294,10 @@ static void weight_data_func(GtkTreeViewColumn *col, gtk_tree_model_get(model, iter, DIVE_INDEX, &indx, -1); dive = get_dive(indx); value = get_weight_units(total_weight(dive), &decimals, NULL); - snprintf(buffer, sizeof(buffer), "%.*f", decimals, value); + if (value == 0.0) + *buffer = '\0'; + else + snprintf(buffer, sizeof(buffer), "%.*f", decimals, value); g_object_set(renderer, "text", buffer, NULL); } @@ -553,6 +556,9 @@ static void fill_one_dive(struct dive *dive, DIVE_OTU, dive->otu, DIVE_TOTALWEIGHT, total_weight(dive), -1); + + free(location); + free(cylinder); } static gboolean set_one_dive(GtkTreeModel *model,