aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoname <noname@inventati.org>2014-04-25 18:28:00 +0400
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2014-04-26 00:03:09 +0200
commitc4b79b055df9ef0126f05dd6dbd2bbf935dcb980 (patch)
treee24f91664555a94a6030a2e313f7da4f17f6cf17
parent7f1e02e4dbb6e6f033797a09a7deea4fe29f2ca6 (diff)
downloadst-c4b79b055df9ef0126f05dd6dbd2bbf935dcb980.tar.gz
st-c4b79b055df9ef0126f05dd6dbd2bbf935dcb980.tar.bz2
Fix for multibyte characters in techo.
Works for both signed and unsigned char.
-rw-r--r--st.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/st.c b/st.c
index 297eb3f..cacbe20 100644
--- a/st.c
+++ b/st.c
@@ -2298,7 +2298,7 @@ techo(char *buf, int len) {
for(; len > 0; buf++, len--) {
char c = *buf;
- if(c < 0x20 || c == 0177) { /* control code */
+ if(BETWEEN(c, 0x00, 0x1f) || c == 0x7f) { /* control code */
if(c != '\n' && c != '\r' && c != '\t') {
c ^= '\x40';
tputc("^", 1);