fuzz: termio.MessageData small_size is max of 255, not 256

This commit is contained in:
Nameless
2023-10-25 11:36:21 -05:00
parent 49f1866f28
commit 41de71ae9e
2 changed files with 3 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ const Config = @import("../config.zig").Config;
pub const Message = union(enum) { pub const Message = union(enum) {
/// Represents a write request. Magic number comes from the max size /// Represents a write request. Magic number comes from the max size
/// we want this union to be. /// we want this union to be.
pub const WriteReq = termio.MessageData(u8, 256); pub const WriteReq = termio.MessageData(u8, 255);
/// Set the title of the surface. /// Set the title of the surface.
/// TODO: we should change this to a "WriteReq" style structure in /// TODO: we should change this to a "WriteReq" style structure in

View File

@@ -84,6 +84,8 @@ pub const Message = union(enum) {
/// are a stable pointer, or require deallocation. This is helpful for thread /// are a stable pointer, or require deallocation. This is helpful for thread
/// messaging utilities. /// messaging utilities.
pub fn MessageData(comptime Elem: type, comptime small_size: comptime_int) type { pub fn MessageData(comptime Elem: type, comptime small_size: comptime_int) type {
assert(small_size <= std.math.maxInt(u8));
return union(enum) { return union(enum) {
pub const Self = @This(); pub const Self = @This();