# std.fs.File.readvAll: fix behavior for 0-length vectors · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/25c3878c00b92ffc884d89d32817ca9c244f7972)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 25c3878c00b92ffc884d89d32817ca9c244f7972

Requested commit: 25c3878c00b92ffc884d89d32817ca9c244f7972

Commit: 25c3878c00b92ffc884d89d32817ca9c244f7972

Tree: fa75c028981da826805ce1db00c21cfa671a36e7

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.fs.File.readvAll: fix behavior for 0-length vectors

The OS layer expects pointer addresses to be inside the application's
address space even if the length is zero. Meanwhile, in Zig, slices may
have undefined pointer addresses when the length is zero. So this
function now modifies the iov_base fields when the length is zero.

```

## Parents

- [7db74009db4a4dc820e3e32c805ab7e29394205b](https://git.cafe/gitcafe/zig/commit/7db74009db4a4dc820e3e32c805ab7e29394205b?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/25c3878c00b92ffc884d89d32817ca9c244f7972?format=markdown)
