Me again, still in pset6, right now working on "load", I did this so far:
bool load(FILE* file, BYTE** content, size_t* length)
{
fseek(file, 0, SEEK_END);
long size = ftell(file);
fseek(file, 0, SEEK_SET);
*content = malloc(size);
if (fread(*content, size, 1, file) == 0)
{
return false;
}
*length = size;
return true;
}
and works fine with every file, except with .php files, when the client asks for a php "size" gets a value of -1 and I don't understand why, any help? Thanks guys!