=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/utf8.c,v retrieving revision 1.29 retrieving revision 1.30 diff -c -r1.29 -r1.30 *** src/usr.bin/tmux/utf8.c 2016/03/02 15:36:03 1.29 --- src/usr.bin/tmux/utf8.c 2016/04/26 07:33:36 1.30 *************** *** 1,4 **** ! /* $OpenBSD: utf8.c,v 1.29 2016/03/02 15:36:03 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: utf8.c,v 1.30 2016/04/26 07:33:36 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott *************** *** 18,23 **** --- 18,24 ---- #include + #include #include #include #include *************** *** 116,123 **** int width; width = wcwidth(wc); ! if (width < 0 || width > 0xff) return (-1); return (width); } --- 117,126 ---- int width; width = wcwidth(wc); ! if (width < 0 || width > 0xff) { ! log_debug("Unicode %04x, wcwidth() %d", wc, width); return (-1); + } return (width); } *************** *** 127,132 **** --- 130,137 ---- { switch (mbtowc(wc, ud->data, ud->size)) { case -1: + log_debug("UTF-8 %.*s, mbtowc() %d", (int)ud->size, ud->data, + errno); mbtowc(NULL, NULL, MB_CUR_MAX); return (UTF8_ERROR); case 0: