mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:08:12 +00:00
Kernel: Keep TTY names in character buffers instead of Strings
Just going over some little unnecessary little kmalloc allocations.
This commit is contained in:
parent
2305dee455
commit
2f37fa487d
7 changed files with 27 additions and 31 deletions
|
@ -966,7 +966,8 @@ int Process::sys$ttyname_r(int fd, char* buffer, ssize_t size)
|
|||
auto tty_name = description->tty()->tty_name();
|
||||
if (size < tty_name.length() + 1)
|
||||
return -ERANGE;
|
||||
strcpy(buffer, tty_name.characters());
|
||||
memcpy(buffer, tty_name.characters_without_null_termination(), tty_name.length());
|
||||
buffer[tty_name.length()] = '\0';
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue