X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=profile.c;h=d3362432effe11b1e0680e9e131d6f457aa5560d;hb=413065dcdccebe3a97813e9c45a654820f98e0e6;hp=614822809f53dd59bcb6ad2575f51b5e8207e398;hpb=a5e822a4d6f742afe2b4b2e6a856af3063b5ffe1;p=ext%2Fsubsurface.git diff --git a/profile.c b/profile.c index 6148228..d336243 100644 --- a/profile.c +++ b/profile.c @@ -14,6 +14,7 @@ #include "color.h" int selected_dive = 0; +int *selectiontracker; typedef enum { STABLE, SLOW, MODERATE, FAST, CRAZY } velocity_t; @@ -1048,16 +1049,18 @@ static void fill_missing_tank_pressures(struct plot_info *pi, pr_track_t **track /* there may be multiple segments - so * let's assemble the length */ nlist = list; - pt = list->pressure_time; - while (!nlist->end) { - nlist = nlist->next; - if (!nlist) { - /* oops - we have no end pressure, - * so this means this is a tank without - * gas consumption information */ - break; + if (list) { + pt = list->pressure_time; + while (!nlist->end) { + nlist = nlist->next; + if (!nlist) { + /* oops - we have no end pressure, + * so this means this is a tank without + * gas consumption information */ + break; + } + pt += nlist->pressure_time; } - pt += nlist->pressure_time; } if (!nlist) { /* just continue without calculating