From bc41b5e7fa2f8ecee280cabfda77808b37e0e9ee Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Mon, 29 Dec 2008 01:11:45 +0200 Subject: [PATCH] =?UTF-8?q?patches=20by=20Rostislav=20Bene=C5=A1:=20mc-25-?= =?UTF-8?q?key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit defensive edits, handle only ascii keys --- src/key.c | 2 +- src/learn.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/key.c b/src/key.c index d531541f5..4ebcd1bff 100644 --- a/src/key.c +++ b/src/key.c @@ -919,7 +919,7 @@ int get_key_code (int no_delay) if (parent != NULL && parent->action == MCKEY_ESCAPE) { /* Convert escape-digits to F-keys */ - if (isdigit(c)) + if (g_ascii_isdigit(c)) c = KEY_F (c - '0'); else if (c == ' ') c = ESC_CHAR; diff --git a/src/learn.c b/src/learn.c index fb9803335..a35252240 100644 --- a/src/learn.c +++ b/src/learn.c @@ -42,6 +42,7 @@ #include "main.h" #include "learn.h" #include "wtools.h" +#include "strutil.h" #define UX 4 #define UY 3 @@ -202,7 +203,7 @@ learn_check_key (int c) /* Prevent from disappearing if a non-defined sequence is pressed and contains a button hotkey. Only recognize hotkeys with ALT. */ - if (c < 255 && isalnum (c)) + if (c < 255 && g_ascii_isalnum (c)) return 1; return 0; @@ -238,7 +239,7 @@ init_learn (void) learn_but[0].x = 78 / 2 + 4; learn_but[1].text = _(learn_but[1].text); - learn_but[1].x = 78 / 2 - (strlen (learn_but[1].text) + 9); + learn_but[1].x = 78 / 2 - (str_term_width1 (learn_but[1].text) + 9); learn_title = _(learn_title); i18n_flag = 1;