mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-14 07:49:01 +02:00
All these return values from utf8_* are confusing, use an enum.
This commit is contained in:
6
input.c
6
input.c
@ -1923,7 +1923,7 @@ input_utf8_open(struct input_ctx *ictx)
|
||||
{
|
||||
struct utf8_data *ud = &ictx->utf8data;
|
||||
|
||||
if (!utf8_open(ud, ictx->ch))
|
||||
if (utf8_open(ud, ictx->ch) != UTF8_MORE)
|
||||
log_fatalx("UTF-8 open invalid %#hhx", ictx->ch);
|
||||
|
||||
log_debug("%s %hhu", __func__, ud->size);
|
||||
@ -1937,7 +1937,7 @@ input_utf8_add(struct input_ctx *ictx)
|
||||
{
|
||||
struct utf8_data *ud = &ictx->utf8data;
|
||||
|
||||
if (utf8_append(ud, ictx->ch) != 1)
|
||||
if (utf8_append(ud, ictx->ch) != UTF8_MORE)
|
||||
log_fatalx("UTF-8 add invalid %#hhx", ictx->ch);
|
||||
|
||||
log_debug("%s", __func__);
|
||||
@ -1951,7 +1951,7 @@ input_utf8_close(struct input_ctx *ictx)
|
||||
{
|
||||
struct utf8_data *ud = &ictx->utf8data;
|
||||
|
||||
if (utf8_append(ud, ictx->ch) != 0)
|
||||
if (utf8_append(ud, ictx->ch) != UTF8_DONE)
|
||||
log_fatalx("UTF-8 close invalid %#hhx", ictx->ch);
|
||||
|
||||
log_debug("%s %hhu '%*s' (width %hhu)", __func__, ud->size,
|
||||
|
Reference in New Issue
Block a user