My server.c works perfectly except for .php files. It displays the PHP correctly but is infinitely loading. The code for my load function is: bool load(FILE* file, BYTE** content, size_t* length) {
unsigned int sz;
fseek(file, 0L, SEEK_END);
sz = ftell(file);
rewind(file);
char* filebuffer = malloc(sz);
fread(filebuffer, sz, 1, file);
*content = filebuffer;
*length = sz;
}
When I have a php file, sz becomes -1. Any ideas why? For all other filetpyes it works perfectly.
thanks,