Daniel Wyatt to slouken
authorSam Lantinga <slouken@libsdl.org>
Thu, 22 Jul 2010 22:09:04 -0700
changeset 45671d7ea8724f4a
parent 4566 40c833d951a1
child 4568 25b9cd8bdc30
Daniel Wyatt to slouken

I also found a bug in the non-printable character fix.
In SDL_keyboard.c:SDL_SendKeyboardText:
if (*text < ' ' || *text == 127) {
needs to be:
if ((unsigned char)*text < ' ' || *text == 127) {

Otherwise bytes >= 128 will be considered non-printable.
src/events/SDL_keyboard.c
     1.1 --- a/src/events/SDL_keyboard.c	Wed Jul 21 21:53:41 2010 -0700
     1.2 +++ b/src/events/SDL_keyboard.c	Thu Jul 22 22:09:04 2010 -0700
     1.3 @@ -768,7 +768,7 @@
     1.4      int posted;
     1.5  
     1.6      /* Don't post text events for unprintable characters */
     1.7 -    if (*text < ' ' || *text == 127) {
     1.8 +    if ((unsigned char)*text < ' ' || *text == 127) {
     1.9          return 0;
    1.10      }
    1.11