[vlc-commits] keys: remove zero-length array

Rémi Denis-Courmont git at videolan.org
Tue May 6 23:07:59 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed May  7 00:07:49 2014 +0300| [a6e1074b68cd71e9ad9d394a2753be2dd5084bdf] | committer: Rémi Denis-Courmont

keys: remove zero-length array

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a6e1074b68cd71e9ad9d394a2753be2dd5084bdf
---

 src/config/keys.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/config/keys.c b/src/config/keys.c
index 07c0d75..1c3304f 100644
--- a/src/config/keys.c
+++ b/src/config/keys.c
@@ -396,7 +396,7 @@ struct vlc_actions
 {
     void *map; /* Key map */
     void *global_map; /* Grabbed/global key map */
-    struct hotkey keys[0];
+    struct hotkey keys[1];
 };
 
 static int vlc_key_to_action (vlc_object_t *obj, const char *varname,
@@ -474,7 +474,7 @@ struct vlc_actions *vlc_InitActions (libvlc_int_t *libvlc)
 {
     vlc_object_t *obj = VLC_OBJECT(libvlc);
     struct hotkey *keys;
-    struct vlc_actions *as = malloc (sizeof (*as) + (ACTIONS_COUNT + 1) * sizeof (*keys));
+    struct vlc_actions *as = malloc (sizeof (*as) + ACTIONS_COUNT * sizeof (*keys));
 
     if (unlikely(as == NULL))
         return NULL;



More information about the vlc-commits mailing list