From b8f69b6b9a1b5339ba580e58725b8866339c1ad7 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 15 Apr 2018 20:34:27 +0300 Subject: [PATCH] os/fs: Fix PVS/V560: condition was already checked in while() It is not possible to enter while loop body with unsigned2 == 0 if loop condition requires unsigned1 < unsigned2. --- src/nvim/os/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index b7c2714296..924b3d2359 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -512,7 +512,7 @@ ptrdiff_t os_readv(int fd, bool *ret_eof, struct iovec *iov, size_t iov_size) } while (read_bytes < toread && iov_size && !*ret_eof) { ptrdiff_t cur_read_bytes = readv(fd, iov, (int)iov_size); - if (toread && cur_read_bytes == 0) { + if (cur_read_bytes == 0) { *ret_eof = true; } if (cur_read_bytes > 0) {