From ba4d6ae62707d20fef8d33ceab3f2de5be3e9ae7 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 25 Jul 2019 07:25:54 +0200 Subject: Cleanup: use clear_git_id() instead of setting saved_git_id For better encapsulation, use clear_git_id() in clear_dive_file_data() instead of setting saved_git_id directly. Thus, memory management of the saved_git_id value is encapsulated and can be modified more easily. Signed-off-by: Berthold Stoeger --- core/divelist.c | 2 +- core/load-git.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/divelist.c b/core/divelist.c index f088195fd..02e5cfc4a 100644 --- a/core/divelist.c +++ b/core/divelist.c @@ -1488,7 +1488,7 @@ void clear_dive_file_data() clear_dive(&displayed_dive); reset_min_datafile_version(); - saved_git_id = ""; + clear_git_id(); } bool dive_less_than(const struct dive *a, const struct dive *b) diff --git a/core/load-git.c b/core/load-git.c index 0915a459e..2ff96ef0b 100644 --- a/core/load-git.c +++ b/core/load-git.c @@ -1625,7 +1625,7 @@ void clear_git_id(void) saved_git_id = NULL; } -void set_git_id(const struct git_oid * id) +void set_git_id(const struct git_oid *id) { static char git_id_buffer[GIT_OID_HEXSZ + 1]; -- cgit v1.2.3-70-g09d2