summaryrefslogtreecommitdiffstats
path: root/core/divesite.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2017-02-19 17:20:09 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-02-19 17:38:34 -0800
commit2e77a22e2cd26820fc8a83c657dffe672df6d8e0 (patch)
treef13425616089957ec2ae5ec9e417d48299483596 /core/divesite.c
parent6e40a510c6e8db6ea8fbd5c7ba0dd1d614068608 (diff)
downloadsubsurface-2e77a22e2cd26820fc8a83c657dffe672df6d8e0.tar.gz
Fix dive site string merging
If the second dive site doesn't have a particular string, but the first one does, we did the wrong thing and created a result string like (first dive site string) or ((null)) which is not useful. We should just use the first dive site string as-is. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'core/divesite.c')
-rw-r--r--core/divesite.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/divesite.c b/core/divesite.c
index 2d7bdbefe..73c198e99 100644
--- a/core/divesite.c
+++ b/core/divesite.c
@@ -275,6 +275,9 @@ static void merge_string(char **a, char **b)
{
char *s1 = *a, *s2 = *b;
+ if (!s2)
+ return;
+
if (same_string(s1, s2))
return;