From c695dde8c378fc095c74ac771fee6251073ce26b Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Thu, 14 Feb 2019 09:31:02 +0000 Subject: [PATCH] ecore wl2 - remove pointless sntrcpys causing warnings again pointless: strcpy(dest, x); -> len - strlen(x); strncpy(dest, x, len); code put in causing new warnings. this kind of "get rid of strcpy" is actua;;y dangerous as it's more likely a mistake is made along the way and bugs are added. strcpy's should be reviewed and if ok - left as-is. doing otherwise makes the code worse, not better and raises risk. it now also produces warnings at compile time which creates noise we just shouldnt' have. --- src/lib/ecore_wl2/ecore_wl2_input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c index 0a7ae211d3..0d480f50e8 100644 --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -635,9 +635,9 @@ _ecore_wl2_input_key_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, xkb_ ev->compose = comp_len ? ev->key + key_len + 1 : NULL; ev->string = ev->compose; - strncpy((char *)ev->keyname, keyname, key_len + 1); - strncpy((char *)ev->key, key, name_len + 1); - if (comp_len) strncpy((char *)ev->compose, compose, comp_len +1); + strcpy((char *)ev->keyname, keyname); + strcpy((char *)ev->key, key); + if (comp_len) strcpy((char *)ev->compose, compose); ev->window = (Ecore_Window)window; ev->event_window = (Ecore_Window)window;