From d19fb9961721361ff15e0273b92e5bc62c8b37b7 Mon Sep 17 00:00:00 2001 From: Divyendu Singh Date: Fri, 25 Oct 2024 10:56:58 +0200 Subject: [PATCH] Update examples/pghostname_zig/src/main.zig --- examples/pghostname_zig/src/main.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pghostname_zig/src/main.zig b/examples/pghostname_zig/src/main.zig index 447c098..4b66c0d 100644 --- a/examples/pghostname_zig/src/main.zig +++ b/examples/pghostname_zig/src/main.zig @@ -7,7 +7,7 @@ comptime { pgzx.PG_EXPORT(@This()); } -pub fn pghostname_zig() ![]const u8 { +pub fn pghostname_zig() ![:0]const u8 { var buffer: [std.posix.HOST_NAME_MAX]u8 = undefined; const hostname = std.posix.gethostname(&buffer) catch "unknown"; return try pgzx.mem.PGCurrentContextAllocator.dupeZ(u8, hostname);