diff --git a/src/modules/hostname.zig b/src/modules/hostname.zig index 068d357..8741a64 100644 --- a/src/modules/hostname.zig +++ b/src/modules/hostname.zig @@ -8,7 +8,7 @@ fn cb() ![]const u8 { const max_hostname_size = c.sysconf(c._SC_HOST_NAME_MAX); const buffer = try std.heap.page_allocator.alloc(u8, @intCast(max_hostname_size)); - const bytes_read = try file.read(buffer); + const bytes_read = try file.read(buffer) - 1; return buffer[0..bytes_read]; }