From 7ba21188c816fd0c2291ce1364d5a781fa4c0bc8 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 8 Jul 2017 00:51:44 +0100 Subject: [PATCH] In do_palt(), mask out unused data bits. This avoids an infinite loop if one of them is inadvertently (or advertently) set. Why might one be set advertently? Well, it would allow us to replace our long lists of numbers with short strings. For instance, the U+0024 DOLLAR SIGN glyph is "NUTNEUN". Sadly that would make the program incompatible with non-ASCII systems and since I claim ANSI C I should probably continue to support those. --- bedstead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bedstead.c b/bedstead.c index 275028d..5231513 100644 --- a/bedstead.c +++ b/bedstead.c @@ -1491,7 +1491,7 @@ dopalt(struct glyph const *g) * characters get an advance width of three pixels. */ for (i = 0; i < YSIZE; i++) - cols |= g->data[i]; + cols |= g->data[i] & ((1 << XSIZE) - 1); if (cols == 0) dh = 3 - XSIZE; else { -- 2.30.2