From fdb7903ea527f777188a1479990753927ac6622d Mon Sep 17 00:00:00 2001 From: Rentib Date: Sat, 19 Oct 2024 17:04:50 +0200 Subject: [PATCH] fix: remove array size from color[] in pixmap_save() Signed-off-by: Rentib --- src/pixmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pixmap.c b/src/pixmap.c index 70b4cba..66f6afc 100644 --- a/src/pixmap.c +++ b/src/pixmap.c @@ -313,9 +313,9 @@ bool pixmap_save(struct pixmap* pm, const char* path) // TODO: add alpha channel fprintf(fp, "P6\n%zu %zu\n255\n", pm->width, pm->height); for (i = 0; i < pm->width * pm->height; ++i) { - uint8_t color[4] = { (((pm->data[i] >> (8 * 2)) & 0xff)), - (((pm->data[i] >> (8 * 1)) & 0xff)), - (((pm->data[i] >> (8 * 0)) & 0xff)) }; + uint8_t color[] = { (((pm->data[i] >> (8 * 2)) & 0xff)), + (((pm->data[i] >> (8 * 1)) & 0xff)), + (((pm->data[i] >> (8 * 0)) & 0xff)) }; fwrite(color, 3, 1, fp); }