From 6911229278cda9b59c1ef808c3b2bed7aff64336 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 16 Sep 2011 20:20:28 -0700 Subject: [PATCH] Make handling of empty airconsumption string consistent Signed-off-by: Dirk Hohndel --- info.c | 2 ++ profile.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/info.c b/info.c index 5cfe728..6834b16 100644 --- a/info.c +++ b/info.c @@ -197,6 +197,8 @@ void update_air_info(char *buffer) { char markup[120]; + if (! buffer) + buffer = EMPTY_AIRCONSUMPTION; snprintf(markup, sizeof(markup), "%s",buffer); gtk_label_set_markup(GTK_LABEL(airconsumption), markup); } diff --git a/profile.c b/profile.c index 0add26d..7b3b883 100644 --- a/profile.c +++ b/profile.c @@ -504,7 +504,7 @@ static void plot_info(struct dive *dive, struct graphics_context *gc) airuse = calculate_airuse(dive); if (!airuse) { - update_air_info(" \n "); + update_air_info(NULL); return; } switch (output_units.volume) { -- 2.43.0