diff options
author | Thomas Adam <thomas@xteddy.org> | 2020-06-02 20:01:18 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2020-06-02 20:01:18 +0100 |
commit | ebe866c378bc5ecd123d3f0d89cf5d3cbc87c9f2 (patch) | |
tree | dfcd1d55dd9b263fa022994555f303315f2c5774 /utf8.c | |
parent | 049ccb4a4b63a83d4fa9e71cebeb458d86e61ae2 (diff) | |
parent | 7e501f1993cc1e4b8344643bcee449cc8c958d7e (diff) | |
download | rtmux-ebe866c378bc5ecd123d3f0d89cf5d3cbc87c9f2.tar.gz rtmux-ebe866c378bc5ecd123d3f0d89cf5d3cbc87c9f2.tar.bz2 rtmux-ebe866c378bc5ecd123d3f0d89cf5d3cbc87c9f2.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -161,14 +161,14 @@ utf8_from_data(const struct utf8_data *ud, utf8_char *uc) m.data[1] = (offset >> 8) & 0xff; m.data[2] = (offset >> 16); } - *uc = m.uc; + *uc = htonl(m.uc); return (UTF8_DONE); fail: if (ud->width == 1) - *uc = utf8_space1.uc; + *uc = htonl(utf8_space1.uc); else - *uc = utf8_space2.uc; + *uc = htonl(utf8_space2.uc); return (UTF8_ERROR); } @@ -176,7 +176,7 @@ fail: void utf8_to_data(utf8_char uc, struct utf8_data *ud) { - union utf8_map m = { .uc = uc }; + union utf8_map m = { .uc = ntohl(uc) }; struct utf8_item *ui; u_int offset; @@ -209,7 +209,7 @@ utf8_build_one(char c, u_int width) if (width == 2) m.flags |= UTF8_FLAG_WIDTH2; - return (m.uc); + return (htonl(m.uc)); } /* Set a single character. */ |