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

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

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

Visibility: public

Requested revision: e098b287e18b8a7a4df0fdb48d32fb4376daba07

Requested commit: e098b287e18b8a7a4df0fdb48d32fb4376daba07

Commit: e098b287e18b8a7a4df0fdb48d32fb4376daba07

Tree: ae36d182b8fd3e3b8ee06dad0558fa3c08c4a52f

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.fs.File.writevAll: 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.

This is a companion commit to b4893eb05565b2cb033c6ed88617d73faf878455.

```

## Parents

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

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