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
Regular → Executable
View File
Regular → Executable
View File
+2 -1
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);