]> Git Repo - qemu.git/blobdiff - util/iov.c
atomics: add atomic_op_fetch variants
[qemu.git] / util / iov.c
index 003fcce66f21c5028de0a2cf028981effefe4e37..74e6ca8ed7298c833e52257923c10fb73c9377ad 100644 (file)
@@ -247,7 +247,8 @@ unsigned iov_copy(struct iovec *dst_iov, unsigned int dst_iov_cnt,
 {
     size_t len;
     unsigned int i, j;
-    for (i = 0, j = 0; i < iov_cnt && j < dst_iov_cnt && bytes; i++) {
+    for (i = 0, j = 0;
+         i < iov_cnt && j < dst_iov_cnt && (offset || bytes); i++) {
         if (offset >= iov[i].iov_len) {
             offset -= iov[i].iov_len;
             continue;
This page took 0.022768 seconds and 4 git commands to generate.