about 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.
Diffstat (limited to '')
-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;
 }
 
sh?id=1025a488ee399099a4ad32257de77404b0881edf&follow=1'>Rename colorscheme "trivial"June McEnroe 2017-05-01Update vendored pathogenJune McEnroe 2017-05-01Clean up git configJune McEnroe 2017-05-01Clean up style in xxJune McEnroe 2017-05-01Clean up style in pbdJune McEnroe 2017-05-01Use EX_OK in pbcopyJune McEnroe 2017-04-30Clean up clockJune McEnroe 2017-04-30Clean up error strings in briJune McEnroe 2017-03-18Add -u option to xxJune McEnroe 2017-03-15Fix non-string-literal-format-string in briJune McEnroe 2017-03-15Fix bri compilationJune McEnroe 2017-03-15Use psvar for title settingJune McEnroe 2017-03-14Add bri brightness control scriptJune McEnroe 2017-03-14Add comment to tmux terminal overrideJune McEnroe 2017-03-13Have tmux set block cursor on linux consoleJune McEnroe 2017-03-13Use inverse for Visual in colorschemeJune McEnroe