diff options
author | Thomas Adam <thomas@xteddy.org> | 2016-05-28 02:01:10 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2016-05-28 02:01:10 +0100 |
commit | 7a2fed494bbd980d602d012fc17d42e0a642a8a5 (patch) | |
tree | 52ac20ada2d66b775e61fcc97aa7c25ccadd0e03 /utf8.c | |
parent | c10d83b4df2d4beb709f2779cab6bbafa957ce09 (diff) | |
parent | 344a6a620233ab351a9875fb52cc2662cdf4aac4 (diff) |
Merge branch 'obsd-master'
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -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. */ |