chiark / gitweb /
In do_palt(), mask out unused data bits.
authorBen Harris <bjh21@bjh21.me.uk>
Fri, 7 Jul 2017 23:51:44 +0000 (00:51 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Fri, 7 Jul 2017 23:51:44 +0000 (00:51 +0100)
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

index 275028d4479188a150c314cc516348130333b68f..5231513673e609635dc3e6f4453ec874ac69f1ac 100644 (file)
@@ -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 {