code cleanup: ensure all fields are initialized

In a total abundance of caution, make sure we don't exit the constructor
leaving fields uninitialized.

Fixes CID 351437

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-01-06 12:11:04 -08:00
parent 2feb7077f8
commit c3614040d9

View file

@ -910,10 +910,16 @@ void PasteDives::redo()
undo();
}
// ***** Paste *****
// ***** ReplanDive *****
ReplanDive::ReplanDive(dive *source, bool edit_profile) : d(current_dive),
when(0),
maxdepth({0}),
meandepth({0}),
dc({ 0 }),
notes(nullptr)
notes(nullptr),
surface_pressure({0}),
duration({0}),
salinity(0)
{
memset(&cylinders, 0, sizeof(cylinders));
if (!d)