diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-03-13 22:12:23 +0100 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2018-04-11 14:01:51 +0300 |
commit | f7b2355cedb75a8ed97644c05d57977f993cb08b (patch) | |
tree | 418456caa1f16a660002867f346ca3f89b88e8fe /core/plannernotes.c | |
parent | 44bcc5a30772237e7f0f47d618af345520fb5804 (diff) | |
download | subsurface-f7b2355cedb75a8ed97644c05d57977f993cb08b.tar.gz |
Cleanup: unconstify results of two functions
get_dive_date_c_string() and get_current_date() return copied strings.
Make this explicit by returning non-const pointers.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/plannernotes.c')
-rw-r--r-- | core/plannernotes.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/plannernotes.c b/core/plannernotes.c index c0647ebe6..e05f27738 100644 --- a/core/plannernotes.c +++ b/core/plannernotes.c @@ -137,15 +137,15 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d dive->notes = strdup(buffer); goto finished; } else if (diveplan->surface_interval >= 48 * 60 *60) { - const char *current_date = get_current_date(); + char *current_date = get_current_date(); len += snprintf(buffer + len, sz_buffer - len, "<div><b>%s (%s) %s %s</b><br>", translate("gettextFromC", "Subsurface"), subsurface_canonical_version(), translate("gettextFromC", "dive plan</b> created on"), current_date); - free((void *)current_date); + free(current_date); } else { - const char *current_date = get_current_date(); + char *current_date = get_current_date(); len += snprintf_loc(buffer + len, sz_buffer - len, "<div><b>%s (%s) %s %d:%02d) %s %s<br>", translate("gettextFromC", "Subsurface"), subsurface_canonical_version(), @@ -153,7 +153,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d FRACTION(diveplan->surface_interval / 60, 60), translate("gettextFromC", "created on"), current_date); - free((void *)current_date); + free(current_date); } if (prefs.display_variations && decoMode() != RECREATIONAL) |