From 855995191ca997ddc41e3ce23422e4adbad16949 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Fri, 3 Feb 2017 22:50:10 +0100 Subject: 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 Signed-off-by: Dirk Hohndel --- core/statistics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3-70-g09d2