Update code to work on mac

This commit is contained in:
Abdelrahman Said 2024-03-22 09:23:16 +00:00
parent 70eb36015c
commit de621996ba
3 changed files with 2 additions and 1 deletions

0
build Normal file → Executable file
View File

0
compile Normal file → Executable file
View File

3
ppm.c
View File

@ -10,7 +10,8 @@ void write_p6_ppm(const char *filepath, u64 width, u64 height, Pixel *data) {
} }
char header[1024] = {0}; char header[1024] = {0};
sprintf(header, "P6\n%lu %lu\n255\n", width, height); sprintf(header, "P6\n%llu %llu\n255\n", (unsigned long long)width,
(unsigned long long)height);
u64 length = strlen(header); u64 length = strlen(header);
fwrite(&header, length, 1, fp); fwrite(&header, length, 1, fp);