summary refs log tree commit diff
path: root/bin/ttpre.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bin/ttpre.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/ttpre.c b/bin/ttpre.c
index 48f24d8f..52e30f54 100644
--- a/bin/ttpre.c
+++ b/bin/ttpre.c
@@ -17,7 +17,6 @@
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 #include <wchar.h>
 
 static void put(const char *tag, wchar_t ch) {
@@ -35,18 +34,19 @@ static void push(wchar_t ch) {
 	static wchar_t q[3];
 	if (q[1] == L'\b' && q[0] == L'_') {
 		put("i", q[2]);
-		memset(q, 0, sizeof(q));
+		q[0] = q[1] = q[2] = 0;
 	} else if (q[1] == L'\b' && q[0] == q[2]) {
 		put("b", q[2]);
-		memset(q, 0, sizeof(q));
+		q[0] = q[1] = q[2] = 0;
 	} else if (q[0]) {
 		put(NULL, q[0]);
 	}
-	memmove(q, &q[1], sizeof(q) - sizeof(wchar_t));
+	q[0] = q[1];
+	q[1] = q[2];
 	q[2] = ch;
 }
 
-int main() {
+int main(void) {
 	setlocale(LC_CTYPE, "");
 	printf("<pre>");
 	wchar_t ch;
or all of UIJune McEnroe vaswprintf is a nightmare. 2018-08-06Rename line editing functionsJune McEnroe 2018-08-05Initialize all possible color pairsJune McEnroe This is actually possible with use_default_colors! 2018-08-05Refactor color initializationJune McEnroe 2018-08-05Add ^L redrawJune McEnroe 2018-08-05Use 16 colors if availableJune McEnroe Fall back to using bold if there are only 8 colors. This also allowed bright background colors in 16-color terminals. I must port this system to torus. I'll be able to remove the awful termcap patch hack. 2018-08-05Limit parsed colors to number of mIRC colorsJune McEnroe Oh boy that's embarrassing. 2018-08-04Show source link on exitJune McEnroe 2018-08-04Implement line editing, scrollingJune McEnroe Don't really have a way to implement the M-* keys, and currently missing C-w. 2018-08-04Handle /topicJune McEnroe