diff options
| author | emekoi <emekankurumeh@outlook.com> | 2018-09-12 07:01:48 -0500 |
|---|---|---|
| committer | emekoi <emekankurumeh@outlook.com> | 2018-09-12 07:01:48 -0500 |
| commit | 54f7d58722e16e47e3781f7a6bd7c80ee4e22520 (patch) | |
| tree | 7592f517abf71d1a1a60a00da1c2bc91ad1116d7 | |
| parent | 6b7f3d01ae3ea2c6535b72339f1023ab426c40fd (diff) | |
| download | zig-54f7d58722e16e47e3781f7a6bd7c80ee4e22520.tar.gz zig-54f7d58722e16e47e3781f7a6bd7c80ee4e22520.zip | |
fixed WriteFile segfault
| -rw-r--r-- | std/os/windows/util.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/std/os/windows/util.zig b/std/os/windows/util.zig index a489cca163..2a1a82a963 100644 --- 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, |
