summaryrefslogtreecommitdiffstats
path: root/utf8.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2016-05-28 02:01:10 +0100
committerThomas Adam <thomas@xteddy.org>2016-05-28 02:01:10 +0100
commit7a2fed494bbd980d602d012fc17d42e0a642a8a5 (patch)
tree52ac20ada2d66b775e61fcc97aa7c25ccadd0e03 /utf8.c
parentc10d83b4df2d4beb709f2779cab6bbafa957ce09 (diff)
parent344a6a620233ab351a9875fb52cc2662cdf4aac4 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/utf8.c b/utf8.c
index 421c0fea..bb0be34f 100644
--- a/utf8.c
+++ b/utf8.c
@@ -31,16 +31,10 @@ static int utf8_width(wchar_t);
void
utf8_set(struct utf8_data *ud, u_char ch)
{
- u_int i;
+ static const struct utf8_data empty = { { 0 }, 1, 1, 1 };
+ memcpy(ud, &empty, sizeof *ud);
*ud->data = ch;
- ud->have = 1;
- ud->size = 1;
-
- ud->width = 1;
-
- for (i = ud->size; i < sizeof ud->data; i++)
- ud->data[i] = '\0';
}
/* Copy UTF-8 character. */