Make Trap.init take zero-terminated slice

main
copygirl 1 year ago
parent 81559ab326
commit 450c4157f9
  1. 4
      src/trap.zig

@ -79,8 +79,8 @@ pub const TrapCode = enum(u8) {
pub const Trap = struct {
/// Creates a new trap.
/// The `Trap` returned is owned by the caller.
pub fn init(message: []const u8) Trap {
return wasmtime_trap_new(message.ptr, message.len);
pub fn init(message: [:0]const u8) Trap {
return wasmtime_trap_new(message.ptr, message.len + 1);
}
pub fn copy(self: *const Trap) Trap {

Loading…
Cancel
Save