summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC/netdb.cpp
diff options
context:
space:
mode:
authorDexesTTP <dexes.ttp@gmail.com>2022-07-05 22:33:15 +0200
committerLinus Groh <mail@linusgroh.de>2022-07-06 11:12:45 +0200
commit7ceeb745354e246ec91cbdcd6f17c8291c09aec0 (patch)
treeff0acc8f5603d392e0f0b82793df40b257e284ea /Userland/Libraries/LibC/netdb.cpp
parentb2454888e8fa44775456536a2a71827763cba503 (diff)
downloadserenity-7ceeb745354e246ec91cbdcd6f17c8291c09aec0.zip
AK: Use an enum instead of a bool for String::replace(all_occurences)
This commit has no behavior changes. In particular, this does not fix any of the wrong uses of the previous default parameter (which used to be 'false', meaning "only replace the first occurence in the string"). It simply replaces the default uses by String::replace(..., ReplaceMode::FirstOnly), leaving them incorrect.
Diffstat (limited to 'Userland/Libraries/LibC/netdb.cpp')
-rw-r--r--Userland/Libraries/LibC/netdb.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibC/netdb.cpp b/Userland/Libraries/LibC/netdb.cpp
index 69e9e3e992..ef93dfd08d 100644
--- a/Userland/Libraries/LibC/netdb.cpp
+++ b/Userland/Libraries/LibC/netdb.cpp
@@ -451,7 +451,7 @@ void endservent()
static bool fill_getserv_buffers(char const* line, ssize_t read)
{
// Splitting the line by tab delimiter and filling the servent buffers name, port, and protocol members.
- auto split_line = StringView(line, read).replace(" ", "\t", true).split('\t');
+ auto split_line = StringView(line, read).replace(" ", "\t", ReplaceMode::All).split('\t');
// This indicates an incorrect file format.
// Services file entries should always at least contain
@@ -474,7 +474,7 @@ static bool fill_getserv_buffers(char const* line, ssize_t read)
__getserv_port_buffer = number.value();
// Remove any annoying whitespace at the end of the protocol.
- __getserv_protocol_buffer = port_protocol_split[1].replace(" ", "", true).replace("\t", "", true).replace("\n", "", true);
+ __getserv_protocol_buffer = port_protocol_split[1].replace(" ", "", ReplaceMode::All).replace("\t", "", ReplaceMode::All).replace("\n", "", ReplaceMode::All);
__getserv_alias_list_buffer.clear();
// If there are aliases for the service, we will fill the alias list buffer.
@@ -630,7 +630,7 @@ void endprotoent()
static bool fill_getproto_buffers(char const* line, ssize_t read)
{
String string_line = String(line, read);
- auto split_line = string_line.replace(" ", "\t", true).split('\t');
+ auto split_line = string_line.replace(" ", "\t", ReplaceMode::All).split('\t');
// This indicates an incorrect file format. Protocols file entries should
// always have at least a name and a protocol.