mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-03 07:29:23 +00:00
Fix an UBSAN warning
This commit is contained in:
parent
f8520e10b2
commit
fde939291d
1 changed files with 1 additions and 1 deletions
|
@ -42,7 +42,7 @@ ssize_t __zipos_read(struct ZiposHandle *h, const struct iovec *iov,
|
|||
x = y = opt_offset != -1 ? opt_offset : h->pos;
|
||||
for (i = 0; i < iovlen && y < h->size; ++i, y += b) {
|
||||
b = min(iov[i].iov_len, h->size - y);
|
||||
memcpy(iov[i].iov_base, h->mem + y, b);
|
||||
if (b) memcpy(iov[i].iov_base, h->mem + y, b);
|
||||
}
|
||||
if (opt_offset == -1) h->pos = y;
|
||||
return y - x;
|
||||
|
|
Loading…
Add table
Reference in a new issue