zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 7bd8a2695b5fe0b1993003c0c6e02cb99de5ab33 (tree)
parent 6b7f3d01ae3ea2c6535b72339f1023ab426c40fd
Author: Andrew Kelley <superjoe30@gmail.com>
Date:   Wed, 12 Sep 2018 09:03:14 -0400

Merge pull request #1506 from emekoi/master

fixed WriteFile segfault
Diffstat:
Mstd/os/windows/util.zig | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/std/os/windows/util.zig b/std/os/windows/util.zig @@ -52,7 +52,8 @@ pub const WriteError = error{ }; pub fn windowsWrite(handle: windows.HANDLE, bytes: []const u8) WriteError!void { - if (windows.WriteFile(handle, bytes.ptr, @intCast(u32, bytes.len), null, null) == 0) { + var bytes_written: windows.DWORD = undefined; + if (windows.WriteFile(handle, bytes.ptr, @intCast(u32, bytes.len), &bytes_written, null) == 0) { const err = windows.GetLastError(); return switch (err) { windows.ERROR.INVALID_USER_BUFFER => WriteError.SystemResources,