summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/input.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-11-14 11:45:43 +0000
committernicm <nicm@openbsd.org>2015-11-14 11:45:43 +0000
commit39d4fc02d8206b43e19f7b5ff5a46d60565cfbc5 (patch)
tree1b2051a39a034281767436ca338147fc794ab025 /usr.bin/tmux/input.c
parentRename a variable in utf8_combine for consistency and use 0xfffd for (diff)
downloadwireguard-openbsd-39d4fc02d8206b43e19f7b5ff5a46d60565cfbc5.tar.xz
wireguard-openbsd-39d4fc02d8206b43e19f7b5ff5a46d60565cfbc5.zip
All these return values from utf8_* are confusing, use an enum.
Diffstat (limited to 'usr.bin/tmux/input.c')
-rw-r--r--usr.bin/tmux/input.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c
index 0730f530d20..2d6b58ca0db 100644
--- a/usr.bin/tmux/input.c
+++ b/usr.bin/tmux/input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: input.c,v 1.91 2015/11/14 10:56:31 nicm Exp $ */
+/* $OpenBSD: input.c,v 1.92 2015/11/14 11:45:43 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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,