[Spice-devel] [PATCH spice-gtk] Fix incorrect array size check

Marc-André Lureau marcandre.lureau at gmail.com
Wed Mar 14 15:26:46 PDT 2012


---
 gtk/spice-channel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index 77b066e..be95f00 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -1863,7 +1863,7 @@ const gchar* spice_channel_type_to_string(gint type)
     };
     const char *str = NULL;
 
-    if (type >= 0 && type < sizeof(to_string)) {
+    if (type >= 0 && type < G_N_ELEMENTS(to_string)) {
         str = to_string[type];
     }
 
-- 
1.7.7.6



More information about the Spice-devel mailing list