1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:58:11 +00:00

Kernel: Move sys$uname to use TypedTransfer

This should equate to roughly the same code but improve typechecking.
This commit is contained in:
kleines Filmröllchen 2022-08-29 13:55:55 +02:00 committed by Linus Groh
parent 7c05eed487
commit 7e11b9a276

View file

@ -29,7 +29,7 @@ ErrorOr<FlatPtr> Process::sys$uname(Userspace<utsname*> user_buf)
hostname().with_shared([&](auto const& name) {
auto length = min(name->length(), UTSNAME_ENTRY_LEN - 1);
memcpy(buf.nodename, name->characters(), length);
AK::TypedTransfer<char>::copy(reinterpret_cast<char*>(buf.nodename), name->characters(), length);
buf.nodename[length] = '\0';
});