mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: turn string data in struct divecomputer into std::string
Simplifies memory management. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
cc39f709ce
commit
b9a2eff3c9
28 changed files with 114 additions and 147 deletions
|
@ -330,9 +330,9 @@ static int divinglog_dive(void *param, int, char **data, char **)
|
|||
dc_settings_start(state);
|
||||
|
||||
if (data[12]) {
|
||||
state->cur_dive->dc.model = strdup(data[12]);
|
||||
state->cur_dive->dc.model = data[12];
|
||||
} else {
|
||||
state->cur_settings.dc.model = strdup("Divinglog import");
|
||||
state->cur_settings.dc.model = "Divinglog import";
|
||||
}
|
||||
|
||||
snprintf(get_buffer, sizeof(get_buffer) - 1, get_cylinder0_template, diveid);
|
||||
|
@ -367,9 +367,9 @@ static int divinglog_dive(void *param, int, char **data, char **)
|
|||
settings_end(state);
|
||||
|
||||
if (data[12]) {
|
||||
state->cur_dive->dc.model = strdup(data[12]);
|
||||
state->cur_dive->dc.model = data[12];
|
||||
} else {
|
||||
state->cur_dive->dc.model = strdup("Divinglog import");
|
||||
state->cur_dive->dc.model = "Divinglog import";
|
||||
}
|
||||
|
||||
snprintf(get_buffer, sizeof(get_buffer) - 1, get_profile_template, diveid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue