mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
mceditor: use MB_LEN_MAX constant.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
a147082c73
commit
19591c4475
@ -516,12 +516,12 @@ edit_translate_key (WEdit * edit, long x_key, int *cmd, int *ch)
|
||||
#else
|
||||
int c;
|
||||
|
||||
if (edit->charpoint >= 4)
|
||||
if (edit->charpoint >= MB_LEN_MAX)
|
||||
{
|
||||
edit->charpoint = 0;
|
||||
edit->charbuf[edit->charpoint] = '\0';
|
||||
}
|
||||
if (edit->charpoint < 4)
|
||||
if (edit->charpoint < MB_LEN_MAX)
|
||||
{
|
||||
edit->charbuf[edit->charpoint++] = x_key;
|
||||
edit->charbuf[edit->charpoint] = '\0';
|
||||
|
@ -5,6 +5,8 @@
|
||||
#ifndef MC__EDIT_WIDGET_H
|
||||
#define MC__EDIT_WIDGET_H
|
||||
|
||||
#include <limits.h> /* MB_LEN_MAX */
|
||||
|
||||
#include "lib/search.h" /* mc_search_t */
|
||||
#include "lib/widget.h" /* Widget */
|
||||
|
||||
@ -80,7 +82,7 @@ struct WEdit
|
||||
/* multibyte support */
|
||||
gboolean utf8; /* It's multibyte file codeset */
|
||||
GIConv converter;
|
||||
char charbuf[4 + 1];
|
||||
char charbuf[MB_LEN_MAX + 1];
|
||||
int charpoint;
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user