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.
This commit is contained in:
Stefan Schmidt 2014-05-16 13:54:54 +02:00
parent 6924e3010c
commit 2389d7f8ee
1 changed files with 1 additions and 1 deletions

View File

@ -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";
}