Fix bug with PPM writing

This commit is contained in:
Abdelrahman Said 2024-05-01 23:52:46 +01:00
parent 8f20c7b30a
commit 55720ac331

View File

@ -60,7 +60,7 @@ int main(int argc, char *argv[]) {
char max[] = {'2', '5', '5', '\n'}; char max[] = {'2', '5', '5', '\n'};
fwrite(max, sizeof(max), 1, out); fwrite(max, sizeof(max), 1, out);
for (u64 i = 0; i < img->buf_length; i += 4) { for (u64 i = 0; i < img->pixel_count; ++i) {
fwrite(&(img->data[i]), sizeof(u8), 3, out); fwrite(&(img->data[i]), sizeof(u8), 3, out);
} }