mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +00:00
StringView: Rename characters() to characters_without_null_termination().
This should make you think twice before trying to use the const char* from a StringView as if it's a null-terminated string.
This commit is contained in:
parent
567551bc12
commit
0e75aba7c3
21 changed files with 57 additions and 46 deletions
|
@ -1,4 +1,5 @@
|
|||
#include <AK/HashTable.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <Kernel/Lock.h>
|
||||
#include <Kernel/Net/EtherType.h>
|
||||
#include <Kernel/Net/EthernetFrameHeader.h>
|
||||
|
@ -100,7 +101,10 @@ void NetworkAdapter::set_ipv4_address(const IPv4Address& address)
|
|||
void NetworkAdapter::set_interface_name(const StringView& basename)
|
||||
{
|
||||
// FIXME: Find a unique name for this interface, starting with $basename.
|
||||
m_name = String::format("%s0", basename.characters());
|
||||
StringBuilder builder;
|
||||
builder.append(basename);
|
||||
builder.append('0');
|
||||
m_name = builder.to_string();
|
||||
}
|
||||
|
||||
bool PacketQueueAlarm::is_ringing() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue