[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41189] trunk/blender/source/blender/ windowmanager/intern/wm_event_system.c: Fix for alt-tab in Windows.

Dalai Felinto dfelinto at gmail.com
Sat Oct 22 07:50:29 CEST 2011


Hi,

Blender assumes '\0' terminated strings everywhere. So why not do the same
with utf8?
In other words, instead of changing here, why not to reinforce the '\0' in
the GHOT_EventKey.h ?

Or even in the GHOST_System* files?

--
Dalai

2011/10/21 Alexander Kuznetsov <kuzsasha at gmail.com>

> Revision: 41189
>
> http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41189
> Author:   alexk
> Date:     2011-10-22 04:36:58 +0000 (Sat, 22 Oct 2011)
> Log Message:
> -----------
> 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)
>
> Modified Paths:
> --------------
>    trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
>
> Modified:
> trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
> ===================================================================
> --- trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
> 2011-10-22 03:39:13 UTC (rev 41188)
> +++ trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
> 2011-10-22 04:36:58 UTC (rev 41189)
> @@ -2611,7 +2611,7 @@
>                        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 */
>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>


More information about the Bf-committers mailing list