From 2389d7f8eeefa3dbb83046e9faa4ef6400ca946f Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Fri, 16 May 2014 13:54:54 +0200 Subject: [PATCH] ecore_imf: Account for terminating null byte on copy strlen retruns the count with the terminating null byte but strncpy expects length with it. Account for that. --- src/modules/ecore_imf/scim/scim_imcontext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/ecore_imf/scim/scim_imcontext.cpp b/src/modules/ecore_imf/scim/scim_imcontext.cpp index 94ee9cf470..3e4b9fc604 100644 --- a/src/modules/ecore_imf/scim/scim_imcontext.cpp +++ b/src/modules/ecore_imf/scim/scim_imcontext.cpp @@ -373,7 +373,7 @@ feed_key_event(Evas *evas, const char *str, Eina_Bool fake) else { if (strlen(str) + 1 > 128) return; - strncpy(key_string, str, strlen(str)); + strncpy(key_string, str, strlen(str) + 1); evas_event_feed_key_down(evas, key_string, key_string, NULL, NULL, timestamp, NULL); SCIM_DEBUG_FRONTEND(1) << " evas_event_feed_key_down()...\n"; }