Commit c4b79b0

noname <noname@inventati.org>
2014-04-25 10:28:00
Fix for multibyte characters in techo.
Works for both signed and unsigned char.
1 parent 7f1e02e
Changed files (1)
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);