summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2017-02-15 17:04:25 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-02-15 21:46:15 -0800
commit83aff9f777136aad55d6246eeb17c4b24b56f405 (patch)
tree0dd80f1e7238e9c91381d11ab91cc258e847cc06 /core
parent78059d401084382235b76d707c85bc637c704f61 (diff)
downloadsubsurface-83aff9f777136aad55d6246eeb17c4b24b56f405.tar.gz
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>
Diffstat (limited to 'core')
-rw-r--r--core/dive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/dive.c b/core/dive.c
index 3dcfebc3e..2c699fb9a 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -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;