Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool load(FILE* file, BYTE** content, size_t* length)
- {
- if(file == NULL)
- {
- return false;
- }
- int c = 1;
- int count = 0;
- char* buffer = malloc(sizeof(char));
- char* apple = buffer;
- while((c=fgetc(file)) != EOF)
- {
- buffer[count] = c;
- count++;
- apple = realloc(buffer, count);
- if(apple == NULL)
- {
- continue;
- }
- }
- *content = buffer;
- *length = count;
- fclose(file);
- return true;
- }
Add Comment
Please, Sign In to add comment