I am trying to print a dynamically downloaded image returned by cURL as shown :
char *raw_image = malloc(1024);
raw_image = doCurl("GET", img_url, NULL, NULL);
printf("Content-Type: image/png\n\n");
fwrite(raw_image, sizeof(raw_image), 20000, stdout);
If I do size smaller than 20000 - image gets cut. How can I make that number dynamic? I don't want to write to a file - stdout is the best option.
Any help is appreciated.