From 83aff9f777136aad55d6246eeb17c4b24b56f405 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 15 Feb 2017 17:04:25 -0800 Subject: 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 Fixes: a031dbbbd ("When merging planned dives keep all cylinders") Signed-off-by: Linus Torvalds --- core/dive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') 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; -- cgit v1.2.3-70-g09d2