diff --git a/test/drivers/event_class/event_class.cpp b/test/drivers/event_class/event_class.cpp index d1b732d89b..5b730aba61 100644 --- a/test/drivers/event_class/event_class.cpp +++ b/test/drivers/event_class/event_class.cpp @@ -1399,13 +1399,13 @@ void event_test::assert_ipv4_string(const char* desired_ipv4, int starting_index void event_test::assert_port_string(const char* desired_port, int starting_index, direction dir) { uint16_t port = *(uint16_t*)(m_event_params[m_current_param].valptr + starting_index); - const char* port_string = std::to_string(port).c_str(); + auto port_string = std::to_string(port); if(dir == DEST) { - ASSERT_STREQ(port_string, desired_port) + ASSERT_STREQ(port_string.c_str(), desired_port) << VALUE_NOT_CORRECT << m_current_param << "(dest port)" << std::endl; } else { - ASSERT_STREQ(port_string, desired_port) + ASSERT_STREQ(port_string.c_str(), desired_port) << VALUE_NOT_CORRECT << m_current_param << "(source port)" << std::endl; } } diff --git a/userspace/libscap/engine/savefile/converter/converter.cpp b/userspace/libscap/engine/savefile/converter/converter.cpp index 932b479f4a..d6eb509441 100644 --- a/userspace/libscap/engine/savefile/converter/converter.cpp +++ b/userspace/libscap/engine/savefile/converter/converter.cpp @@ -359,7 +359,7 @@ static conversion_result convert_event(scap_evt *new_evt, scap_evt *tmp_evt = NULL; // We iterate over the instructions - for(int i = 0; i < ci.m_instrs.size(); i++, param_to_populate++) { + for(size_t i = 0; i < ci.m_instrs.size(); i++, param_to_populate++) { PRINT_MESSAGE("Instruction n° %d. Param to populate: %d\n", i, param_to_populate); switch(ci.m_instrs[i].flags) {