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

Pavel Grunt pgrunt at redhat.com
Thu Feb 23 13:30:51 UTC 2017


On Wed, 2017-02-22 at 14:11 +0100, Victor Toso wrote:
> From: Victor Toso <me at victortoso.com>
> 
> Signed-off-by: Victor Toso <victortoso at redhat.com>
Acked-by: Pavel Grunt <pgrunt 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++) {


More information about the Spice-devel mailing list