aboutsummaryrefslogtreecommitdiff
path: root/src/io.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/io.zig')
-rw-r--r--src/io.zig6
1 files changed, 5 insertions, 1 deletions
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 {