aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2018-03-07 10:51:46 -0800
committerCedric Bail <cedric@osg.samsung.com>2018-03-07 10:51:46 -0800
commit012bcff80cbf0a89a708c5544d9defd81057b927 (patch)
tree759feb3bb5ff567ed0ffbd984f0775300467c59f /src/lib/ecore_wl2/ecore_wl2_input.c
parentelementary: fix backward compatibility bug introduced by 9c8749b99a03d3601321... (diff)
downloadefl-012bcff80cbf0a89a708c5544d9defd81057b927.tar.gz
ecore_wl2: cleanup input code to string logic to reduce compiler warning and useless memory access.
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_input.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 3c8c3d4183..3082c5af05 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -624,22 +624,18 @@ static void
_ecore_wl2_input_key_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, xkb_keysym_t sym, xkb_keysym_t sym_name, unsigned int code, unsigned int state, unsigned int timestamp)
{
Ecore_Event_Key *ev;
- char key[256], keyname[256], compose[256];
+ char key[256] = "", keyname[256] = "", compose[256] = "";
int name_len, key_len, comp_len;
- memset(key, 0, sizeof(key));
- memset(keyname, 0, sizeof(keyname));
- memset(compose, 0, sizeof(compose));
-
/*try to get a name or utf char of the given symbol */
_ecore_wl2_input_symbol_rep_find(sym, key, sizeof(key), code);
_ecore_wl2_input_symbol_rep_find(sym_name, keyname, sizeof(keyname), code);
_ecore_wl2_input_key_translate(sym, input->keyboard.modifiers,
compose, sizeof(compose));
- name_len = (keyname) ? strlen(keyname) : 0;
- key_len = (key) ? strlen(key) : 0;
- comp_len = (compose) ? strlen(compose) : 0;
+ name_len = strlen(keyname);
+ key_len = strlen(key);
+ comp_len = strlen(compose);
ev = calloc(1, sizeof(Ecore_Event_Key) + key_len + name_len + comp_len + 3);
if (!ev) return;