summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-01-17 00:52:29 -0500
committerJune McEnroe <june@causal.agency>2019-01-17 00:53:09 -0500
commit2318430fe66460e611c76a3f422ce5e4c9bcd17f (patch)
tree950f944bb41950aa5e4c2e128981eb03865b3ee7
parentFix some symbols in sans8x16 (diff)
downloadsrc-2318430fe66460e611c76a3f422ce5e4c9bcd17f.tar.gz
src-2318430fe66460e611c76a3f422ce5e4c9bcd17f.zip
Don't use string functions in ttpre
-rw-r--r--bin/ttpre.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/ttpre.c b/bin/ttpre.c
index e6be5d34..7acf8475 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;