=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/utf8.c,v retrieving revision 1.50 retrieving revision 1.51 diff -c -r1.50 -r1.51 *** src/usr.bin/tmux/utf8.c 2020/06/02 11:29:00 1.50 --- src/usr.bin/tmux/utf8.c 2020/06/02 17:17:44 1.51 *************** *** 1,4 **** ! /* $OpenBSD: utf8.c,v 1.50 2020/06/02 11:29:00 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: utf8.c,v 1.51 2020/06/02 17:17:44 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott *************** *** 162,175 **** m.data[1] = (offset >> 8) & 0xff; m.data[2] = (offset >> 16); } ! *uc = m.uc; return (UTF8_DONE); fail: if (ud->width == 1) ! *uc = utf8_space1.uc; else ! *uc = utf8_space2.uc; return (UTF8_ERROR); } --- 162,175 ---- m.data[1] = (offset >> 8) & 0xff; m.data[2] = (offset >> 16); } ! *uc = htonl(m.uc); return (UTF8_DONE); fail: if (ud->width == 1) ! *uc = htonl(utf8_space1.uc); else ! *uc = htonl(utf8_space2.uc); return (UTF8_ERROR); } *************** *** 177,183 **** void utf8_to_data(utf8_char uc, struct utf8_data *ud) { ! union utf8_map m = { .uc = uc }; struct utf8_item *ui; u_int offset; --- 177,183 ---- void utf8_to_data(utf8_char uc, struct utf8_data *ud) { ! union utf8_map m = { .uc = ntohl(uc) }; struct utf8_item *ui; u_int offset; *************** *** 210,216 **** if (width == 2) m.flags |= UTF8_FLAG_WIDTH2; ! return (m.uc); } /* Set a single character. */ --- 210,216 ---- if (width == 2) m.flags |= UTF8_FLAG_WIDTH2; ! return (htonl(m.uc)); } /* Set a single character. */