basic/io-util: move iterator variable declarations into loop headers

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-05-04 14:57:49 +02:00
parent cf1e6e6260
commit 2f9d1da95a
+2 -2
View File
@@ -25,9 +25,9 @@ int fd_wait_for_event(int fd, int event, usec_t timeout);
ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length);
static inline size_t IOVEC_TOTAL_SIZE(const struct iovec *i, size_t n) {
size_t j, r = 0;
size_t r = 0;
for (j = 0; j < n; j++)
for (size_t j = 0; j < n; j++)
r += i[j].iov_len;
return r;