[PATCH] only access trip's location if trip is not NULL
Dirk Hohndel
dirk at hohndel.org
Mon May 19 21:56:48 PDT 2014
Linus fixed the same one while we were on the boat and I just pushed this
out as commit 3159a90b0aa6 - sorry about that...
/D
On Thu, May 15, 2014 at 10:39:19PM +0200, me at bearsh.org wrote:
> From: Martin Gysel <me at bearsh.org>
>
> in case the dive has no divetrip, don't try to access its location
>
> Signed-off-by: Martin Gysel <me at bearsh.org>
> ---
> save-git.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/save-git.c b/save-git.c
> index 3fd8807..2757757 100644
> --- a/save-git.c
> +++ b/save-git.c
> @@ -850,7 +850,7 @@ static void create_commit_message(struct membuffer *msg)
> nr = dive->number;
>
> put_format(msg, "dive %d: %s", nr, location);
> - if (trip->location && *trip->location && strcmp(trip->location, location))
> + if (trip && trip->location && *trip->location && strcmp(trip->location, location))
> put_format(msg, " (%s)", trip->location);
> put_format(msg, "\n\n");
> }
> --
> 1.9.3
>
> _______________________________________________
> subsurface mailing list
> subsurface at hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
More information about the subsurface
mailing list