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

ByteBuffer: Remove pointer() in favor of data()

We had two ways to get the data inside a ByteBuffer. That was silly.
This commit is contained in:
Andreas Kling 2019-09-30 08:57:01 +02:00
parent dd696e7c75
commit 8f45a259fc
30 changed files with 89 additions and 92 deletions

View file

@ -42,7 +42,7 @@ static void load_etc_hosts()
auto line = file->read_line(1024);
if (line.is_empty())
break;
auto str_line = String((const char*)line.pointer(), line.size() - 1, Chomp);
auto str_line = String((const char*)line.data(), line.size() - 1, Chomp);
auto fields = str_line.split('\t');
auto sections = fields[0].split('.');
@ -254,7 +254,7 @@ Vector<String> lookup(const String& hostname, bool& did_timeout, const String& D
dst_addr.sin_port = htons(53);
rc = inet_pton(AF_INET, DNS_IP.characters(), &dst_addr.sin_addr);
int nsent = sendto(fd, buffer.pointer(), buffer.size(), 0, (const struct sockaddr*)&dst_addr, sizeof(dst_addr));
int nsent = sendto(fd, buffer.data(), buffer.size(), 0, (const struct sockaddr*)&dst_addr, sizeof(dst_addr));
if (nsent < 0) {
perror("sendto");
return {};