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>
This commit is contained in:
Robert C. Helling 2017-02-03 22:50:10 +01:00 committed by Dirk Hohndel
parent db7290a915
commit 855995191c

View file

@ -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;