]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Make handling of empty airconsumption string consistent
authorDirk Hohndel <dirk@hohndel.org>
Sat, 17 Sep 2011 03:20:28 +0000 (20:20 -0700)
committerDirk Hohndel <dirk@hohndel.org>
Sat, 17 Sep 2011 03:20:28 +0000 (20:20 -0700)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
info.c
profile.c

diff --git a/info.c b/info.c
index 5cfe7286cb32ad406d945a8865c4019fd8bb1ac1..6834b1645c81174001453fb849d6f818efed80c0 100644 (file)
--- 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), "<span font=\"8\">%s</span>",buffer);
        gtk_label_set_markup(GTK_LABEL(airconsumption), markup);
 }
index 0add26d0844d98fb824f669c4c0593d360d4e8b7..7b3b8833316a2a54a9d8c864b3c5ace804164754 100644 (file)
--- 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) {