Skip to content

Commit

Permalink
fix: remove array size from color[] in pixmap_save()
Browse files Browse the repository at this point in the history
Signed-off-by: Rentib <[email protected]>
  • Loading branch information
Rentib committed Oct 19, 2024
1 parent 6ecf2c7 commit fdb7903
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pixmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit fdb7903

Please sign in to comment.