Fix crash when merging dives with a missing dive computer model

The test for the dive being a planned dive was completely bogus:

 - it should use "same_string()" which correctly checks for NULL

 - the string it checks for is obviously spelled wrong anyway.

Reported-by: Alessandro Volpi <volpial@gmail.com>
Fixes: a031dbbbd ("When merging planned dives keep all cylinders")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2017-02-15 17:04:25 -08:00 committed by Dirk Hohndel
parent 78059d4010
commit 83aff9f777

View file

@ -3139,7 +3139,7 @@ struct dive *merge_dives(struct dive *a, struct dive *b, int offset, bool prefer
dl = b;
}
if (!strcmp(a->dc.model, "planneed dive")) {
if (same_string(a->dc.model, "planned dive")) {
struct dive *tmp = a;
a = b;
b = tmp;