fix for incorrect (partial) written sequences when libc wcwidth() == -1
[st.git] / st.c
diff --git a/st.c b/st.c
index c161497..5d4054f 100644 (file)
--- a/st.c
+++ b/st.c
@@ -2312,10 +2312,8 @@ tputc(Rune u)
                width = len = 1;
        } else {
                len = utf8encode(u, c);
-               if (!control && (width = wcwidth(u)) == -1) {
-                       memcpy(c, "\357\277\275", 4); /* UTF_INVALID */
+               if (!control && (width = wcwidth(u)) == -1)
                        width = 1;
-               }
        }
 
        if (IS_SET(MODE_PRINT))