diff --git a/src/connection.zig b/src/connection.zig index 3d5eb7c..b904f30 100644 --- a/src/connection.zig +++ b/src/connection.zig @@ -15,11 +15,11 @@ pub const Connection = struct { }; t: Connection.Type, - path: ?[]const u8, // Not always needed. + path: ?[:0]const u8, // Not always needed. const Self = @This(); - pub fn init(t: Connection.Type, path: ?[]const u8) Self { + pub fn init(t: Connection.Type, path: ?[:0]const u8) Self { return Self{ .t = t, .path = path, diff --git a/src/context.zig b/src/context.zig index 4af6417..0fa4465 100644 --- a/src/context.zig +++ b/src/context.zig @@ -51,7 +51,7 @@ pub const Context = struct { pub fn init(allocator: std.mem.Allocator) !Self { const rundir = std.process.getEnvVarOwned(allocator, "RUNDIR") catch |err| switch (err) { error.EnvironmentVariableNotFound => blk: { - break :blk try allocator.dupeZ(u8, "/tmp/.libipc-run/"); + break :blk try allocator.dupe(u8, "/tmp/.libipc-run/"); }, else => { return err;