diff --git a/rzip.c b/rzip.c index 774d4d6..7793257 100644 --- a/rzip.c +++ b/rzip.c @@ -766,8 +766,8 @@ void rzip_fd(int fd_in, int fd_out) /* Check if there's enough free space on the device chosen to fit the * compressed file, based on the compressed file being as large as the * uncompressed file. */ - if (unlikely(fstatvfs(fd_in, &fbuf))) - fatal("Failed to fstatvfs in decompress_file\n"); + if (unlikely(fstatvfs(fd_out, &fbuf))) + fatal("Failed to fstatvfs in compress_file\n"); free_space = fbuf.f_bsize * fbuf.f_bavail; if (free_space < control.st_size) { if (FORCE_REPLACE)