summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-10-25 14:01:55 -0400
committerJune McEnroe <june@causal.agency>2021-10-25 14:01:55 -0400
commit4744d65752f4d56d0383150327b7f3331763a046 (patch)
tree84d310806bccad52af13e60a9794cade7f804adb
parentOnly match first Nm for feed (diff)
downloadsrc-4744d65752f4d56d0383150327b7f3331763a046.tar.gz
src-4744d65752f4d56d0383150327b7f3331763a046.zip
Bounds check color indexes
Diffstat (limited to '')
-rw-r--r--bin/shotty.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/shotty.l b/bin/shotty.l
index 8018d785..577696bb 100644
--- a/bin/shotty.l
+++ b/bin/shotty.l
@@ -498,7 +498,7 @@ static void span(const struct Cell *prev, const struct Cell *cell) {
 		if (attr & Bold) printf("font-weight:bold;");
 		if (attr & Italic) printf("font-style:italic;");
 		if (attr & Underline) printf("text-decoration:underline;");
-		if (colors) {
+		if (colors && bg < 256 && fg < 256) {
 			printf(
 				"background-color:#%06X;color:#%06X;",
 				Palette[bg], Palette[fg]