summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-01-14 20:08:45 -0500
committerJune McEnroe <june@causal.agency>2020-01-14 20:10:20 -0500
commit2ecafb0e4e31c7aa63e5f95fa24dbac10d5c2e8b (patch)
tree2d89c84f0988bce59d469c8437f3e905995e5d94
parentImplement IRC formatting to ANSI translation (diff)
downloadlitterbox-2ecafb0e4e31c7aa63e5f95fa24dbac10d5c2e8b.tar.gz
litterbox-2ecafb0e4e31c7aa63e5f95fa24dbac10d5c2e8b.zip
Ensure ansi resets formatting and null-terminates
fmemopen in text-mode only ensures the buffer is null-terminated if the
last write does not fill the buffer.
-rw-r--r--scoop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/scoop.c b/scoop.c
index 241ef3e..006a416 100644
--- a/scoop.c
+++ b/scoop.c
@@ -123,8 +123,10 @@ static const char *ansi(const char *str) {
 			}
 		}
 	}
-
+	fprintf(out, "\33[m");
 	fclose(out);
+
+	buf[sizeof(buf) - 1] = '\0';
 	return buf;
 }
 
class='logsubject'>Set LANG in cgit filtersJune McEnroe ttpre needs to know about UTF-8 too so it can bold/italic non-ASCII chars. 2019-12-20Source .editrc before applying -v or -eJune McEnroe Otherwise a bind -v in .editrc will take precedence and overwrite the ^I binding for sh-complete. 2019-12-20Disable signing commitsJune McEnroe Why did I ever turn this on? This gets me nothing but inconvenience. RIP to all the wasted bytes in my git repos. 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 Hack: output an extra <td> after rendering mdoc so that line numbers can be hidden based on there being three. This required splitting source-filter and about-filter since on about pages there is no table. 2019-12-18Customize cgit CSSJune McEnroe 2019-12-18Use :target rather than :focus pseudo-classJune McEnroe :target persists after you click on something else. 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 NULs in the input cause an infinite loop in htmlEscape, not to mention regexes obviously not working, etc. 2019-12-16Post "cgit setup"June McEnroe