From: Dirk Hohndel Date: Sat, 17 Sep 2011 03:20:28 +0000 (-0700) Subject: Make handling of empty airconsumption string consistent X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=6911229278cda9b59c1ef808c3b2bed7aff64336;p=ext%2Fsubsurface.git Make handling of empty airconsumption string consistent Signed-off-by: Dirk Hohndel --- 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) {