From 4ad8dcebd8d8f2f8e20ff0ff5c0bc1304406d44f Mon Sep 17 00:00:00 2001 From: Yi-Soo An Date: Thu, 20 Sep 2018 12:45:33 +0900 Subject: [PATCH] flattenlistmodel: Fix uninitialized variable warning Variable, added, would be a garbage value if model is NULL and the following code, if condition, use the uninitialized variable. A side effect could be occurred by that. To avoid, the variable is initialized to zero. --- gtk/gtkflattenlistmodel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkflattenlistmodel.c b/gtk/gtkflattenlistmodel.c index 3f5e83711e..b7066742b7 100644 --- a/gtk/gtkflattenlistmodel.c +++ b/gtk/gtkflattenlistmodel.c @@ -480,7 +480,7 @@ void gtk_flatten_list_model_set_model (GtkFlattenListModel *self, GListModel *model) { - guint removed, added; + guint removed, added = 0; g_return_if_fail (GTK_IS_FLATTEN_LIST_MODEL (self)); g_return_if_fail (model == NULL || G_IS_LIST_MODEL (model));