summaryrefslogtreecommitdiff
path: root/src/lib/ecore_sdl
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_sdl
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_sdl')
-rw-r--r--src/lib/ecore_sdl/ecore_sdl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ecore_sdl/ecore_sdl.c b/src/lib/ecore_sdl/ecore_sdl.c
index 8b5897794b..ff026f5702 100644
--- a/src/lib/ecore_sdl/ecore_sdl.c
+++ b/src/lib/ecore_sdl/ecore_sdl.c
@@ -129,7 +129,7 @@ _ecore_sdl_event_key(SDL_Event *event, double timestamp)
129 Ecore_Event_Key *ev; 129 Ecore_Event_Key *ev;
130 unsigned int i; 130 unsigned int i;
131 131
132 ev = malloc(sizeof(Ecore_Event_Key)); 132 ev = calloc(1, sizeof(Ecore_Event_Key));
133 if (!ev) return NULL; 133 if (!ev) return NULL;
134 134
135 ev->timestamp = timestamp; 135 ev->timestamp = timestamp;