# fix off-by-one error in std.unicode.utf8ToUtf16LeWithNull · gitcafe/zig

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

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

Visibility: public

Requested revision: 3b622f4494b8fd899abc20e75e46726344f2d20c

Requested commit: 3b622f4494b8fd899abc20e75e46726344f2d20c

Commit: 3b622f4494b8fd899abc20e75e46726344f2d20c

Tree: 4110aaab9e8748020861c0ff7d4211314d079e0c

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
fix off-by-one error in std.unicode.utf8ToUtf16LeWithNull

and fix larger-than-one-byte sentinels when being freed

Thank you to João Pedro for identifying both problems and
providing example code to solve them.

closes #4413

```

## Parents

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

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