bool load(FILE* file, BYTE** content, size_t* length)
{
char* data = malloc(sizeof(BYTE));
int i = 0;
while ((data[i] = fgetc(file)) != EOF)
{
i++;
data = realloc(data, (sizeof(BYTE) * i) );
}
*content = data; //store address of memory in *content
*length = i; //store length of memory in *length
free(data);
return true;
}
I'm having problems with server.c and wanted to see if it's because of my load function implementation. Any help would be appreciated.