mirror of
https://github.com/fairyglade/ly.git
synced 2025-12-20 19:24:53 +00:00
@@ -511,12 +511,12 @@ fn addUtmpEntry(entry: *Utmp, username: []const u8, pid: c_int) !void {
|
||||
|
||||
// Get the TTY name (i.e. without the /dev/ prefix)
|
||||
var ttyname_buf: [@sizeOf(@TypeOf(entry.ut_line))]u8 = undefined;
|
||||
const ttyname = try std.fmt.bufPrintZ(&ttyname_buf, "{s}", .{tty_path["/dev/".len..]});
|
||||
_ = try std.fmt.bufPrintZ(&ttyname_buf, "{s}", .{tty_path["/dev/".len..]});
|
||||
|
||||
entry.ut_line = ttyname_buf;
|
||||
// Get the TTY ID (i.e. without the tty prefix) and truncate it to the size
|
||||
// of ut_id if necessary
|
||||
entry.ut_id = ttyname["tty".len..(@sizeOf(@TypeOf(entry.ut_id)) + "tty".len)].*;
|
||||
entry.ut_id = ttyname_buf["tty".len..(@sizeOf(@TypeOf(entry.ut_id)) + "tty".len)].*;
|
||||
|
||||
var username_buf: [@sizeOf(@TypeOf(entry.ut_user))]u8 = undefined;
|
||||
_ = try std.fmt.bufPrintZ(&username_buf, "{s}", .{username});
|
||||
|
||||
Reference in New Issue
Block a user