diff options
Diffstat (limited to 'Utilities/cmlibarchive/libarchive/archive_read_open_file.c')
-rw-r--r-- | Utilities/cmlibarchive/libarchive/archive_read_open_file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_open_file.c b/Utilities/cmlibarchive/libarchive/archive_read_open_file.c index b1aac0a..3a33c25 100644 --- a/Utilities/cmlibarchive/libarchive/archive_read_open_file.c +++ b/Utilities/cmlibarchive/libarchive/archive_read_open_file.c @@ -108,11 +108,11 @@ static ssize_t file_read(struct archive *a, void *client_data, const void **buff) { struct read_FILE_data *mine = (struct read_FILE_data *)client_data; - ssize_t bytes_read; + size_t bytes_read; *buff = mine->buffer; bytes_read = fread(mine->buffer, 1, mine->block_size, mine->f); - if (bytes_read < 0) { + if (bytes_read < mine->block_size && ferror(mine->f)) { archive_set_error(a, errno, "Error reading file"); } return (bytes_read); |