mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
UserspaceEmulator: Remove some unneeded String copies
This commit is contained in:
parent
57f0f8c9b7
commit
4d756c7d2d
Notes:
sideshowbarker
2024-07-19 01:45:08 +09:00
Author: https://github.com/alimpfard
Commit: 4d756c7d2d
Pull-request: https://github.com/SerenityOS/serenity/pull/3831
Reviewed-by: https://github.com/awesomekling
1 changed files with 2 additions and 2 deletions
|
@ -1114,11 +1114,11 @@ int Emulator::virt$realpath(FlatPtr params_addr)
|
|||
Syscall::SC_realpath_params params;
|
||||
mmu().copy_from_vm(¶ms, params_addr, sizeof(params));
|
||||
|
||||
auto path = String::copy(mmu().copy_buffer_from_vm((FlatPtr)params.path.characters, params.path.length));
|
||||
auto path = mmu().copy_buffer_from_vm((FlatPtr)params.path.characters, params.path.length);
|
||||
char host_buffer[PATH_MAX] = {};
|
||||
|
||||
Syscall::SC_realpath_params host_params;
|
||||
host_params.path = { path.characters(), path.length() };
|
||||
host_params.path = { (const char*)path.data(), path.size() };
|
||||
host_params.buffer = { host_buffer, sizeof(host_buffer) };
|
||||
int rc = syscall(SC_realpath, &host_params);
|
||||
if (rc < 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue