diff options
-rwxr-xr-x | file_reader.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/file_reader.c b/file_reader.c index c262091..e679c1c 100755 --- a/file_reader.c +++ b/file_reader.c | |||
@@ -8,9 +8,9 @@ File* file_open(const char* filename) | |||
8 | retval->name = filename; | 8 | retval->name = filename; |
9 | 9 | ||
10 | FILE* file = fopen(retval->name, "rb"); | 10 | FILE* file = fopen(retval->name, "rb"); |
11 | fseek(file, 0, SEEK_END); // go to the end of the file | ||
12 | if(file) | 11 | if(file) |
13 | { | 12 | { |
13 | fseek(file, 0, SEEK_END); // go to the end of the file | ||
14 | retval->size = ftell(0); // save the position (end of the file) | 14 | retval->size = ftell(0); // save the position (end of the file) |
15 | retval->data = malloc(retval->size + 1); | 15 | retval->data = malloc(retval->size + 1); |
16 | fseek(file, 0, SEEK_SET); // return to the beginning of the file | 16 | fseek(file, 0, SEEK_SET); // return to the beginning of the file |