[Spice-devel] [spice-gtk v1 2/7] gtk-session: initialize array without memset

Victor Toso victortoso at redhat.com
Wed Feb 22 13:11:07 UTC 2017


From: Victor Toso <me at victortoso.com>

Signed-off-by: Victor Toso <victortoso at redhat.com>
---
 src/spice-gtk-session.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
index 3c78e6a..bc47f6b 100644
--- a/src/spice-gtk-session.c
+++ b/src/spice-gtk-session.c
@@ -611,7 +611,7 @@ static void clipboard_get_targets(GtkClipboard *clipboard,
     g_return_if_fail(SPICE_IS_GTK_SESSION(self));
 
     SpiceGtkSessionPrivate *s = self->priv;
-    guint32 types[SPICE_N_ELEMENTS(atom2agent)];
+    guint32 types[SPICE_N_ELEMENTS(atom2agent)] = { 0 };
     char *name;
     int a, m, t;
     int selection;
@@ -631,7 +631,6 @@ static void clipboard_get_targets(GtkClipboard *clipboard,
         }
     }
 
-    memset(types, 0, sizeof(types));
     for (a = 0; a < n_atoms; a++) {
         name = gdk_atom_name(atoms[a]);
         for (m = 0; m < SPICE_N_ELEMENTS(atom2agent); m++) {
-- 
2.9.3



More information about the Spice-devel mailing list