diff options
Diffstat (limited to 'src/dump.zig')
| -rw-r--r-- | src/dump.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dump.zig b/src/dump.zig index 06721be1..08736c84 100644 --- a/src/dump.zig +++ b/src/dump.zig @@ -254,7 +254,7 @@ pub fn check(gpa: std.mem.Allocator, bytes: []const u8, why: *[256]u8) !void { error.NoDump => "it holds no dump", error.OutOfMemory => "out of memory", else => "it is no dump of pardes's", - }}) catch unreachable; // a literal or an error's name fits 255 + }}) catch why[0 .. why.len - 1]; // cut at 255 why[said.len] = 0; return err; }; @@ -266,7 +266,7 @@ pub fn check(gpa: std.mem.Allocator, bytes: []const u8, why: *[256]u8) !void { error.BadDump => "it does not begin as one", error.EndOfDump => "it is cut short", else => @errorName(err), - }}) catch unreachable; // a literal or an error's name fits 255 + }}) catch why[0 .. why.len - 1]; // cut at 255 why[said.len] = 0; return err; }; |
