From 36cc2648755308fb98b8ff6ffc76d2e6f6bef75c Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Thu, 17 Jan 2019 00:52:29 -0500 Subject: Don't use string functions in ttpre --- bin/ttpre.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bin') 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 #include #include -#include #include 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("
");
 	wchar_t ch;
-- 
cgit 1.4.1

'/src/tree/bin/when.y?id=8be35f11ac32818deba275cd1aa5ad9b7f044c4b'>tree commit diff
Commit message (Expand)Author
2020-01-04Replace gr alias with git resetJune McEnroe
2020-01-03Remove shotty -c flag from upJune McEnroe
2020-01-03Add Darling Don't CryJune McEnroe
2020-01-01Update license header templates for the new yearJune McEnroe
2019-12-26Add \S to sort inside bracesJune McEnroe
2019-12-23Reformat music.txtJune McEnroe
2019-12-23Rename music.md to music.txtJune McEnroe
2019-12-23Add DO YOU DOUBT ME TRAITORJune McEnroe
2019-12-22Add license header to cgit CSSJune McEnroe
2019-12-22Add The Book of EttaJune McEnroe
2019-12-21Revert "Add first working version of imbox"June McEnroe
2019-12-21Add first working version of imboxJune McEnroe
2019-12-20Respect mailmap in gl pretty formatJune McEnroe
2019-12-20Set LANG in cgit filtersJune McEnroe
2019-12-20Source .editrc before applying -v or -eJune McEnroe
2019-12-20Disable signing commitsJune McEnroe
2019-12-19Ignore about-filterJune McEnroe
2019-12-19Fix matching make tags with no sourcesJune McEnroe
2019-12-19Avoid matching := assignments as tagsJune McEnroe
2019-12-18Hide line numbers when rendering mdocJune McEnroe
2019-12-18Customize cgit CSSJune McEnroe
2019-12-18Use :target rather than :focus pseudo-classJune McEnroe
2019-12-18Copy cgit auxiliary binaries properlyJune McEnroe
2019-12-18Add git.causal.agency cgit configJune McEnroe
2019-12-18Bail from hi if input is binaryJune McEnroe
2019-12-16Post "cgit setup"June McEnroe