zig

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

commit d29ed2a78567e26065e021d6dd2cbcb952b9d7d0 (tree)
parent b702964ae279156418f1110435103e30167af982
Author: daurnimator <quae@daurnimator.com>
Date:   Tue, 14 Apr 2020 01:24:18 +1000

std: fix StreamSource to disallow writing to a const buffer

Diffstat:
Mlib/std/io/stream_source.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/std/io/stream_source.zig b/lib/std/io/stream_source.zig @@ -39,7 +39,7 @@ pub const StreamSource = union(enum) { pub fn write(self: *StreamSource, bytes: []const u8) WriteError!usize { switch (self.*) { .buffer => |*x| return x.write(bytes), - .const_buffer => |*x| return x.write(bytes), + .const_buffer => return error.AccessDenied, .file => |x| return x.write(bytes), } }