1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:17:45 +00:00

AK+Userland: Fix some compiler warnings and make variables const-ref

This fixes a few compiler warnings and makes some variables const-ref
in preparation for the next commit which changes how ByteBuffer works.
This commit is contained in:
Gunnar Beutner 2021-05-14 20:53:27 +02:00 committed by Andreas Kling
parent fbdc3b0ee2
commit f0fa51773a
7 changed files with 12 additions and 7 deletions

View file

@ -466,7 +466,7 @@ static bool fill_getserv_buffers(const char* line, ssize_t read)
}
auto alias = split_line[i].to_byte_buffer();
alias.append("\0", sizeof(char));
__getserv_alias_list_buffer.append(alias);
__getserv_alias_list_buffer.append(move(alias));
}
}
@ -636,7 +636,7 @@ static bool fill_getproto_buffers(const char* line, ssize_t read)
break;
auto alias = split_line[i].to_byte_buffer();
alias.append("\0", sizeof(char));
__getproto_alias_list_buffer.append(alias);
__getproto_alias_list_buffer.append(move(alias));
}
}

View file

@ -13,7 +13,7 @@ Vector<String> MimeData::formats() const
{
Vector<String> mime_types;
mime_types.ensure_capacity(m_data.size());
for (auto it : m_data)
for (auto& it : m_data)
mime_types.unchecked_append(it.key);
return mime_types;
}

View file

@ -383,6 +383,7 @@ ssize_t TLSv12::handle_message(ReadonlyBytes buffer)
if (m_context.connection_status != ConnectionStatus::KeyExchange) {
dbgln("unexpected change cipher message");
auto packet = build_alert(true, (u8)AlertDescription::UnexpectedMessage);
write_packet(packet);
payload_res = (i8)Error::UnexpectedMessage;
} else {
dbgln_if(TLS_DEBUG, "change cipher spec message");