summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/divelist.c b/divelist.c
index 17f24ef7e..f0a66b456 100644
--- a/divelist.c
+++ b/divelist.c
@@ -311,6 +311,8 @@ static double calculate_airuse(struct dive *dive)
start = cyl->start.mbar ? cyl->start : cyl->sample_start;
end = cyl->end.mbar ? cyl->end : cyl->sample_end;
+ if (!end.mbar || start.mbar <= end.mbar)
+ continue;
airuse += gas_volume(cyl, start) - gas_volume(cyl, end);
}