[gparted] Initialise local POD 'launched' variable in show_help()



commit 8effaf4f22c6c6eb14d4ed1db63eb4a170d43eab
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Thu Feb 28 11:02:10 2019 +0000

    Initialise local POD 'launched' variable in show_help()
    
    'launched' local POD (Plain Old Data) variable was left uninitialised,
    but was set in both the try and catch clauses.  Best practice is to
    initialise when defined, so do that instead.  Cosmetic change.

 src/Win_GParted.cc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc
index 1bf0fb0c..5f0db81b 100644
--- a/src/Win_GParted.cc
+++ b/src/Win_GParted.cc
@@ -1795,7 +1795,7 @@ void Win_GParted::show_help(const Glib::ustring & filename /* E.g., "gparted" */
 
                context->set_timestamp(gtk_get_current_event_time());
 
-               bool launched;
+               bool launched = false;
                Glib::ustring error2_msg;
                try
                {
@@ -1804,7 +1804,6 @@ void Win_GParted::show_help(const Glib::ustring & filename /* E.g., "gparted" */
                catch (Glib::Error& e)
                {
                        error2_msg = e.what();
-                       launched = false;
                }
 
                if (!launched)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]