summaryrefslogtreecommitdiff
path: root/src/keys.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/keys.zig')
-rw-r--r--src/keys.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/keys.zig b/src/keys.zig
index ece79651..5ebdc046 100644
--- a/src/keys.zig
+++ b/src/keys.zig
@@ -91,7 +91,7 @@ pub fn questionChoices(p: *const Pardes, id: usize, buf: []u8) ?[]const u8 {
var w = std.Io.Writer.fixed(buf);
for (ask.offered, 0..) |serial, i| if (serial != 0) {
if (w.buffered().len > 0) w.writeByte(' ') catch unreachable; // 26 letters and spaces fit 64
- w.writeByte(@intCast('a' + i)) catch unreachable;
+ w.writeByte(@intCast('a' + i)) catch unreachable; // [26]u32 offered: 51 bytes fit 64
};
return w.buffered();
},
@@ -112,7 +112,7 @@ pub fn answerQuestion(p: *Pardes, id: usize, choice: ?u8) bool {
if (questionChoices(p, id, &offered)) |choices| {
const chosen: ?u8 = if (choice) |c| (if (std.mem.indexOfScalar(u8, choices, c) != null and c != ' ') c else null) else null;
var rec: [32]u8 = undefined;
- ctlfs.events.notePath(p, "answer", std.fmt.bufPrint(&rec, "{d} {c}", .{ asked.serial, chosen orelse '-' }) catch unreachable); // a u32 and a letter
+ ctlfs.events.notePath(p, "answer", std.fmt.bufPrint(&rec, "{d} {c}", .{ asked.serial, chosen orelse '-' }) catch unreachable); // a u32 and a letter fit 32
}
switch (asked.prompt) {
.repl_choice => {