Fix for alt-tab in Windows.

utf8_buf can be not null terminated, plus not init as in this case. (I need to investigate more)
This commit is contained in:
Alexander Kuznetsov
2011-10-22 04:36:58 +00:00
parent 19f79f73a8
commit 8f4a015684

View File

@@ -2611,7 +2611,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
GHOST_TEventKeyData *kd= customdata;
event.type= convert_key(kd->key);
event.ascii= kd->ascii;
strcpy(event.utf8_buf, kd->utf8_buf);
memcpy(event.utf8_buf, kd->utf8_buf,sizeof(event.utf8_buf));/* might be not null terminated*/
event.val= (type==GHOST_kEventKeyDown)?KM_PRESS:KM_RELEASE;
/* exclude arrow keys, esc, etc from text input */