summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wayland
diff options
context:
space:
mode:
authorJean-Philippe ANDRE <jpeg@videolan.org>2015-03-25 15:29:49 -0700
committerJean-Philippe ANDRE <jpeg@videolan.org>2015-03-25 15:34:23 -0700
commit0ef41604e88b8a8224818824217ebc09c93789d5 (patch)
tree667a8d2abcc482aa9ae8deef1f7ed74aa3584ed3 /src/lib/ecore_wayland
parentf30c0ea3997e92d527d662cd9e33e76ed3fe0343 (diff)
Ecore: Use calloc() to initialize Ecore_Event_Key fully
Some fields (eg. data) may not be properly initialized. Use calloc() instead of malloc() will ensure proper initialization even if we add more fields. These fields (data) would even be passed down to Evas as Evas_Event_Key_Down for instance.
Diffstat (limited to 'src/lib/ecore_wayland')
-rw-r--r--src/lib/ecore_wayland/ecore_wl_input.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c
index d9f2fd3..6a873e0 100644
--- a/src/lib/ecore_wayland/ecore_wl_input.c
+++ b/src/lib/ecore_wayland/ecore_wl_input.c
@@ -804,7 +804,7 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN
804 _ecore_wl_input_keymap_translate_keysym(sym, input->modifiers, 804 _ecore_wl_input_keymap_translate_keysym(sym, input->modifiers,
805 compose, sizeof(compose)); 805 compose, sizeof(compose));
806 806
807 e = malloc(sizeof(Ecore_Event_Key) + strlen(key) + strlen(keyname) + 807 e = calloc(1, sizeof(Ecore_Event_Key) + strlen(key) + strlen(keyname) +
808 ((compose[0] != '\0') ? strlen(compose) : 0) + 3); 808 ((compose[0] != '\0') ? strlen(compose) : 0) + 3);
809 if (!e) return; 809 if (!e) return;
810 810