[hackers] [st] Fix for multibyte characters in techo. || noname

From: <git_AT_suckless.org>
Date: Sat, 26 Apr 2014 00:06:54 +0200

commit c4b79b055df9ef0126f05dd6dbd2bbf935dcb980
Author: noname <noname_AT_inventati.org>
Date: Fri Apr 25 18:28:00 2014 +0400

    Fix for multibyte characters in techo.
    
    Works for both signed and unsigned char.

diff --git a/st.c b/st.c
index 297eb3f..cacbe20 100644
--- a/st.c
+++ b/st.c
_AT_@ -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 != '
' && c != ' ' && c != ' ') {
                                 c ^= '\x40';
                                 tputc("^", 1);
Received on Sat Apr 26 2014 - 00:06:54 CEST

This archive was generated by hypermail 2.3.0 : Sat Apr 26 2014 - 00:12:24 CEST