core: turn struct dive string data into std::string

Much easier memory management!

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-29 20:40:18 +02:00 committed by bstoeger
parent 2b3d2f1020
commit 3cb04d230b
34 changed files with 208 additions and 313 deletions

View file

@ -179,7 +179,7 @@ static int dm4_dive(void *param, int, char **data, char **)
state->cur_dive->when = (time_t)(atol(data[1]));
if (data[2])
utf8_string(data[2], &state->cur_dive->notes);
utf8_string_std(data[2], &state->cur_dive->notes);
/*
* DM4 stores Duration and DiveTime. It looks like DiveTime is
@ -367,7 +367,7 @@ static int dm5_dive(void *param, int, char **data, char **)
state->cur_dive->when = (time_t)(atol(data[1]));
if (data[2])
utf8_string(data[2], &state->cur_dive->notes);
utf8_string_std(data[2], &state->cur_dive->notes);
if (data[3])
state->cur_dive->duration.seconds = atoi(data[3]);