Skip to content

Commit

Permalink
Fix clang tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
lordgamez committed Oct 19, 2023
1 parent 6ecb8a5 commit 117687c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion controller/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ nonstd::expected<void, std::string> getDebugBundle(const utils::net::SocketData&
const auto next_read_size = (std::min)(bundle_size, BUFFER_SIZE);
const auto size_read = connection_stream->read(std::as_writable_bytes(std::span(out_buffer).subspan(0, next_read_size)));
bundle_size -= size_read;
out_file.write(out_buffer.data(), size_read);
out_file.write(out_buffer.data(), gsl::narrow<std::streamsize>(size_read));
}
return {};
}
Expand Down
10 changes: 5 additions & 5 deletions libminifi/src/c2/C2Agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ C2Payload C2Agent::prepareConfigurationOptions(const C2ContentResponse &resp) co
}

void C2Agent::handle_clear(const C2ContentResponse &resp) {
ClearOperand operand;
ClearOperand operand = ClearOperand::connection;
try {
operand = utils::enumCast<ClearOperand>(resp.name, true);
} catch(const std::runtime_error&) {
Expand Down Expand Up @@ -487,7 +487,7 @@ void C2Agent::handle_clear(const C2ContentResponse &resp) {
* to be put into the acknowledgement
*/
void C2Agent::handle_describe(const C2ContentResponse &resp) {
DescribeOperand operand;
DescribeOperand operand = DescribeOperand::metrics;
try {
operand = utils::enumCast<DescribeOperand>(resp.name, true);
} catch(const std::runtime_error&) {
Expand Down Expand Up @@ -589,7 +589,7 @@ void C2Agent::handle_describe(const C2ContentResponse &resp) {
}

void C2Agent::handle_update(const C2ContentResponse &resp) {
UpdateOperand operand;
UpdateOperand operand = UpdateOperand::configuration;
try {
operand = utils::enumCast<UpdateOperand>(resp.name, true);
} catch(const std::runtime_error&) {
Expand Down Expand Up @@ -693,7 +693,7 @@ C2Payload C2Agent::bundleDebugInfo(std::map<std::string, std::unique_ptr<io::Inp
}

void C2Agent::handle_transfer(const C2ContentResponse &resp) {
TransferOperand operand;
TransferOperand operand = TransferOperand::debug;
try {
operand = utils::enumCast<TransferOperand>(resp.name, true);
} catch(const std::runtime_error&) {
Expand Down Expand Up @@ -1009,7 +1009,7 @@ void C2Agent::handleAssetUpdate(const C2ContentResponse& resp) {

{
std::ofstream file{file_path, std::ofstream::binary};
file.write(reinterpret_cast<const char*>(raw_data.data()), raw_data.size());
file.write(reinterpret_cast<const char*>(raw_data.data()), gsl::narrow<std::streamsize>(raw_data.size()));
}

C2Payload response(Operation::acknowledge, state::UpdateState::FULLY_APPLIED, resp.ident, true);
Expand Down
2 changes: 1 addition & 1 deletion libminifi/src/c2/ControllerSocketProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ void ControllerSocketProtocol::handleTransfer(io::BaseStream &stream) {
}

asio::awaitable<void> ControllerSocketProtocol::handleCommand(std::unique_ptr<io::BaseStream> stream) {
uint8_t head;
uint8_t head = 0;
if (stream->read(head) != 1) {
logger_->log_error("Connection broke");
co_return;
Expand Down

0 comments on commit 117687c

Please sign in to comment.