gnucash maint: fix spurious error about uninitialized have_end

Christopher Lam clam at code.gnucash.org
Fri Aug 27 08:26:33 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/b4205246 (commit)
	from  https://github.com/Gnucash/gnucash/commit/e3fd6bf4 (commit)



commit b42052464ba9701a3d1834fc58fa0deb32ab9afe
Author: Romanos Skiadas <rom.skiad at gmail.com>
Date:   Fri Aug 27 01:00:32 2021 +0300

    fix spurious error about uninitialized have_end
    
    in gnc_tree_view_account_select_subaccounts, gcc thinks have_end might
    not be initialized, but since the function exits if num_children == 0,
    the while (num_children) loop will always be entered. Silence the
    warning.

diff --git a/gnucash/gnome-utils/gnc-tree-view-account.c b/gnucash/gnome-utils/gnc-tree-view-account.c
index 904921365..35c33f2e8 100644
--- a/gnucash/gnome-utils/gnc-tree-view-account.c
+++ b/gnucash/gnome-utils/gnc-tree-view-account.c
@@ -1676,7 +1676,7 @@ gnc_tree_view_account_select_subaccounts (GncTreeViewAccount *view,
     GtkTreeSelection *selection;
     GtkTreePath *sp_account, *sp_start, *sp_end;
     GtkTreeIter si_account, si_start, si_end;
-    gboolean have_start, have_end;
+    gboolean have_start, have_end = FALSE;
     gint num_children;
 
     ENTER("view %p, account %p (%s)", view, account, xaccAccountGetName(account));



Summary of changes:
 gnucash/gnome-utils/gnc-tree-view-account.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the gnucash-changes mailing list