fix hostname module adding a newline after itself
This commit is contained in:
parent
4082f2b015
commit
7a26969f30
1 changed files with 1 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ fn cb() ![]const u8 {
|
||||||
|
|
||||||
const max_hostname_size = c.sysconf(c._SC_HOST_NAME_MAX);
|
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 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];
|
return buffer[0..bytes_read];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue