Input fixes

This commit is contained in:
2026-03-17 13:04:34 +01:00
parent a20d560133
commit f956f1b9f8

View File

@@ -37,12 +37,13 @@ fn getInput(message: []const u8) !usize {
var line_buffer: [100]u8 = undefined;
var w: std.io.Writer = .fixed(&line_buffer);
while (true) {
w.end = 0;
try output.writeAll(message);
try output.flush();
const line_length = try stdin.interface.streamDelimiterLimit(&w, '\n', .unlimited);
stdin.interface.toss(1);
const input_line = line_buffer[0..line_length];
const res = std.fmt.parseInt(usize, input_line, 10) catch {