Return an std::string to avoid memory management headaches.
While doing that, convert time.c to C++ so that
format_datetime directly returns an std::string.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Simplifies memory management. Think about unglobalizing this,
once everything is in C++ so that we can put an std::string
into struct divelog.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
get_changes_made(), subsurface_user_agent() and normalize_cloud_name()
are only called from C++.
Avoids having to manually free the returned value and is therefore
more robust against leaks.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The code is now much easier to check for memory leaks,
since there are no explicit free()s. Yes, memory is not
released immediately, but that should be of no concern.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>