From c3614040d94051d4d6702bbf02239e055de8da67 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 6 Jan 2020 12:11:04 -0800 Subject: 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 --- commands/command_edit.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'commands') diff --git a/commands/command_edit.cpp b/commands/command_edit.cpp index 31ca4ea23..89e10b000 100644 --- a/commands/command_edit.cpp +++ b/commands/command_edit.cpp @@ -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) -- cgit v1.2.3-70-g09d2