mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
Everywhere: Port to String::copy_characters_to_buffer()
This commit is contained in:
parent
be6cce5530
commit
852454746e
Notes:
sideshowbarker
2024-07-19 02:59:36 +09:00
Author: https://github.com/bugaevc
Commit: 852454746e
Pull-request: https://github.com/SerenityOS/serenity/pull/3296
Reviewed-by: https://github.com/BenWiederhake
Reviewed-by: https://github.com/alimpfard
8 changed files with 39 additions and 18 deletions
|
@ -87,10 +87,9 @@ public:
|
|||
ASSERT(type() == Type::Local);
|
||||
sockaddr_un address;
|
||||
address.sun_family = AF_LOCAL;
|
||||
if (m_local_address.length() >= sizeof(address.sun_path)) {
|
||||
bool fits = m_local_address.copy_characters_to_buffer(address.sun_path, sizeof(address.sun_path));
|
||||
if (!fits)
|
||||
return {};
|
||||
}
|
||||
strcpy(address.sun_path, m_local_address.characters());
|
||||
return address;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue