diff options
author | Julien Dessaux | 2023-12-18 07:26:01 +0100 |
---|---|---|
committer | Julien Dessaux | 2023-12-18 15:16:51 +0100 |
commit | 83af8ab1249b98bb5cf691b88bfc947d1d688710 (patch) | |
tree | aa6833315a336959fbca035b82106ce81d5e5add /src/io.zig | |
parent | Updated README for last zig version (diff) | |
download | zigfunge98-83af8ab1249b98bb5cf691b88bfc947d1d688710.tar.gz zigfunge98-83af8ab1249b98bb5cf691b88bfc947d1d688710.tar.bz2 zigfunge98-83af8ab1249b98bb5cf691b88bfc947d1d688710.zip |
zig 0.11 changes
Diffstat (limited to '')
-rw-r--r-- | src/io.zig | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 { |