]> git.draconx.ca Git - rrace.git/commitdiff
ewmhicon: Fix colourmap generation in w32vga mode.
authorNick Bowler <nbowler@draconx.ca>
Sat, 6 Jan 2024 07:31:15 +0000 (02:31 -0500)
committerNick Bowler <nbowler@draconx.ca>
Sat, 6 Jan 2024 20:57:37 +0000 (15:57 -0500)
The bitmap tracking which colours are used is not properly initialized
to zero, so the generated XPM potentially includes a bunch of garbage
in the colourmap section.

No idea why this went unnoticed before as it is completely not working
today.

t/ewmhicon.c

index 5919363549a3f72bc779ba842f19753ded4cb854..ffd1d98a9480ae702e4903dc6f43a3a350598e15 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Test app for _NET_WM_ICON formatting.
- * Copyright © 2022-2023 Nick Bowler
+ * Copyright © 2022-2024 Nick Bowler
  *
  * Use a fake colour scheme to generate an icon of the chosen size (16x16,
  * 24x24, 32x32 or 48x48) and display the pixels as characters.
@@ -142,7 +142,7 @@ static void print_xpm_w32vga(unsigned long size, unsigned long *icon_buf)
        };
 
        unsigned long prev_colour = 0;
-       unsigned used_colours, v;
+       unsigned used_colours = 0, v;
 
        size = (unsigned long) w * h;
        for (i = 0; i < size; i++) {