mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
db7290a915
commit
855995191c
1 changed files with 1 additions and 1 deletions
|
@ -369,7 +369,7 @@ void get_gas_used(struct dive *dive, volume_t gases[MAX_CYLINDERS])
|
||||||
pressure_t start, end;
|
pressure_t start, end;
|
||||||
|
|
||||||
for_each_dc(dive, dc) {
|
for_each_dc(dive, dc) {
|
||||||
if (!strcmp(dc->model, "planned dive"))
|
if (same_string(dc->model, "planned dive"))
|
||||||
continue;
|
continue;
|
||||||
if (has_gaschange_event(dive, dc, idx))
|
if (has_gaschange_event(dive, dc, idx))
|
||||||
used = true;
|
used = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue