summaryrefslogtreecommitdiff
path: root/src/lib/ecore_psl1ght
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_psl1ght
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_psl1ght')
-rw-r--r--src/lib/ecore_psl1ght/ecore_psl1ght.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/ecore_psl1ght/ecore_psl1ght.c b/src/lib/ecore_psl1ght/ecore_psl1ght.c
index ad73f00502..e0f5580e69 100644
--- a/src/lib/ecore_psl1ght/ecore_psl1ght.c
+++ b/src/lib/ecore_psl1ght/ecore_psl1ght.c
@@ -351,7 +351,7 @@ _ecore_psl1ght_event_key(u16 key)
351 u16 utf16; 351 u16 utf16;
352 unsigned int i; 352 unsigned int i;
353 353
354 ev = malloc(sizeof(Ecore_Event_Key)); 354 ev = calloc(1, sizeof(Ecore_Event_Key));
355 if (!ev) return NULL; 355 if (!ev) return NULL;
356 356
357 ev->timestamp = _ecore_psl1ght_get_time (); 357 ev->timestamp = _ecore_psl1ght_get_time ();
@@ -467,7 +467,7 @@ _ecore_psl1ght_pad_button (const char *name, int pressed)
467{ 467{
468 Ecore_Event_Key *ev = NULL; 468 Ecore_Event_Key *ev = NULL;
469 469
470 ev = malloc(sizeof(Ecore_Event_Key)); 470 ev = calloc(1, sizeof(Ecore_Event_Key));
471 if (!ev) return; 471 if (!ev) return;
472 472
473 ev->timestamp = _ecore_psl1ght_get_time (); 473 ev->timestamp = _ecore_psl1ght_get_time ();