Skip to content

Commit

Permalink
Coverity: Fix for CID-1544449, CID-1497428 and CID-1497258 (#11870)
Browse files Browse the repository at this point in the history
Fix Invalid type in argument to printf format specifier
  • Loading branch information
brbzull0 authored Nov 19, 2024
1 parent 74579b6 commit f9aabac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/proxy/http/remap/unit-tests/nexthop_test_stubs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,6 @@ HostStatus::setHostStatus(const std::string_view host, TSHostStatus status, unsi
this->hosts_statuses[std::string(host)]->status = status;
this->hosts_statuses[std::string(host)]->reasons = reason;
this->hosts_statuses[std::string(host)]->local_down_time = down_time;
NH_Dbg(DbgCtl{"next_hop"}, "setting host status for '%.*s' to %s", host.size(), host.data(), HostStatusNames[status]);
NH_Dbg(DbgCtl{"next_hop"}, "setting host status for '%.*s' to %s", static_cast<int>(host.size()), host.data(),
HostStatusNames[status]);
}
6 changes: 4 additions & 2 deletions src/tscore/Diags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,8 @@ Diags::should_roll_diagslog()
log_log_trace("%s: rolling_enabled = %d, output_rolling_size = %d, output_rolling_interval = %d\n", __func__,
diagslog_rolling_enabled, diagslog_rolling_size, diagslog_rolling_interval);
log_log_trace("%s: RollingEnabledValues::ROLL_ON_TIME = %d\n", __func__, RollingEnabledValues::ROLL_ON_TIME);
log_log_trace("%s: time(0) - last_roll_time = %d\n", __func__, time(nullptr) - diagslog_time_last_roll);
log_log_trace("%s: time(0) - last_roll_time = %" PRId64 "\n", __func__,
static_cast<int64_t>(time(nullptr) - diagslog_time_last_roll));

// Roll diags_log if necessary
if (diags_log && diags_log->is_init()) {
Expand Down Expand Up @@ -619,7 +620,8 @@ Diags::should_roll_outputlog()
log_log_trace("%s: rolling_enabled = %d, output_rolling_size = %d, output_rolling_interval = %d\n", __func__,
outputlog_rolling_enabled, outputlog_rolling_size, outputlog_rolling_interval);
log_log_trace("%s: RollingEnabledValues::ROLL_ON_TIME = %d\n", __func__, RollingEnabledValues::ROLL_ON_TIME);
log_log_trace("%s: time(0) - last_roll_time = %d\n", __func__, time(nullptr) - outputlog_time_last_roll);
log_log_trace("%s: time(0) - last_roll_time = %" PRId64 "\n", __func__,
static_cast<int64_t>(time(nullptr) - outputlog_time_last_roll));
log_log_trace("%s: stdout_log = %p\n", __func__, stdout_log);

// Roll stdout_log if necessary
Expand Down

0 comments on commit f9aabac

Please sign in to comment.