Skip to content

Commit

Permalink
Update examples/pghostname_zig/src/main.zig
Browse files Browse the repository at this point in the history
  • Loading branch information
divyenduz authored Oct 25, 2024
1 parent 08d2a20 commit d19fb99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/pghostname_zig/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d19fb99

Please sign in to comment.