diff options
-rw-r--r-- | src/std/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/std/file.c b/src/std/file.c index f0d769e..4542aba 100644 --- a/src/std/file.c +++ b/src/std/file.c @@ -199,7 +199,7 @@ int read_whole_file(const char *filepath, Buffer *data_result) { result = fseek(file, 0, SEEK_SET); if(result != 0) { - result = ferror(file); + result = -1; goto cleanup; } @@ -213,7 +213,7 @@ int read_whole_file(const char *filepath, Buffer *data_result) { cleanup_if_error(buffer_append_empty(data_result, size)); bytes_read = fread(data_result->data, 1, data_result->size, file); if(bytes_read != (unsigned long)size) - result = ferror(file); + result = -1; cleanup: fclose(file); |