mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: port printGPSCoordsC to return std::string
Less memory management hassle. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
119fe908c7
commit
2f3d8d83f5
4 changed files with 7 additions and 9 deletions
|
@ -181,10 +181,9 @@ static void parse_dive_gps(char *line, struct membuffer *, struct git_parser_sta
|
|||
add_dive_to_dive_site(state->active_dive, ds);
|
||||
} else {
|
||||
if (dive_site_has_gps_location(ds) && !same_location(&ds->location, &location)) {
|
||||
char *coords = printGPSCoordsC(&location);
|
||||
std::string coords = printGPSCoordsC(&location);
|
||||
// we have a dive site that already has GPS coordinates
|
||||
ds->notes = add_to_string(ds->notes, translate("gettextFromC", "multiple GPS locations for this dive site; also %s\n"), coords);
|
||||
free(coords);
|
||||
ds->notes = add_to_string(ds->notes, translate("gettextFromC", "multiple GPS locations for this dive site; also %s\n"), coords.c_str());
|
||||
}
|
||||
ds->location = location;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue