.. due to short write, but it's almost impossible for most fses.

Coverity-id: 541575
Signed-off-by: Gao Xiang <hsiang...@linux.alibaba.com>
---
 lib/io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/io.c b/lib/io.c
index b6eb22a..5c3d263 100644
--- a/lib/io.c
+++ b/lib/io.c
@@ -31,7 +31,7 @@ ssize_t __erofs_io_write(int fd, const void *buf, size_t len)
        ssize_t ret, written = 0;
 
        do {
-               ret = write(fd, buf, len);
+               ret = write(fd, buf, len - written);
                if (ret <= 0) {
                        if (!ret)
                                break;
-- 
2.43.5

Reply via email to