From 83af8ab1249b98bb5cf691b88bfc947d1d688710 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 18 Dec 2023 07:26:01 +0100 Subject: zig 0.11 changes --- src/io.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/io.zig') diff --git a/src/io.zig b/src/io.zig index 54abcfc..2cc0047 100644 --- a/src/io.zig +++ b/src/io.zig @@ -60,7 +60,11 @@ pub fn Context(comptime readerType: anytype, comptime writerType: anytype) type try std.testing.expectEqual(ioContext.decimalInput(), error.IOError); } pub fn characterOutput(self: Self, v: i64) !void { - try self.writer.print("{c}", .{@intCast(u8, v)}); + var vv: u8 = '?'; + if (v >= 0 and v <= 255) { + vv = @intCast(v); + } + try self.writer.print("{c}", .{vv}); return; } pub fn decimalOutput(self: Self, v: i64) !void { -- cgit v1.2.3