summaryrefslogtreecommitdiffstats
path: root/core/statistics.c
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2017-02-03 22:50:10 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-02-03 15:04:51 -0800
commit855995191ca997ddc41e3ce23422e4adbad16949 (patch)
treec2b1a2a9bfbef1ad3fe182962a3179fa3da566c0 /core/statistics.c
parentdb7290a9152bc4da4ecd6d928115cd27d3f45293 (diff)
downloadsubsurface-855995191ca997ddc41e3ce23422e4adbad16949.tar.gz
Don't do strcmp on NIL pointer
This is what we have same_string() for... This prevents a crash when saving a dive in the planner. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/statistics.c')
-rw-r--r--core/statistics.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/statistics.c b/core/statistics.c
index d10854c01..233025dd3 100644
--- a/core/statistics.c
+++ b/core/statistics.c
@@ -369,7 +369,7 @@ void get_gas_used(struct dive *dive, volume_t gases[MAX_CYLINDERS])
pressure_t start, end;
for_each_dc(dive, dc) {
- if (!strcmp(dc->model, "planned dive"))
+ if (same_string(dc->model, "planned dive"))
continue;
if (has_gaschange_event(dive, dc, idx))
used = true;