debug_window: Use a string literal as a format string

Fixes clang "format-security" error.
This commit is contained in:
sephiroth99
2015-12-30 14:18:35 -05:00
parent 235f58d757
commit fe30941c9b

View File

@@ -318,7 +318,7 @@ void DebugWindow::DrawSourcePane() {
// name text box (editable) // name text box (editable)
// combo for interleaved + [ppc, hir, opt hir, x64 + byte with sizes] // combo for interleaved + [ppc, hir, opt hir, x64 + byte with sizes]
ImGui::AlignFirstTextHeightToWidgets(); ImGui::AlignFirstTextHeightToWidgets();
ImGui::Text(function->module()->name().c_str()); ImGui::Text("%s", function->module()->name().c_str());
ImGui::SameLine(); ImGui::SameLine();
ImGui::Dummy(ImVec2(4, 0)); ImGui::Dummy(ImVec2(4, 0));
ImGui::SameLine(); ImGui::SameLine();
@@ -657,7 +657,7 @@ bool DebugWindow::DrawRegisterTextBox(int id, uint32_t* value) {
auto alt_value = state_.register_input_hex auto alt_value = state_.register_input_hex
? std::to_string(*value) ? std::to_string(*value)
: string_util::to_hex_string(*value); : string_util::to_hex_string(*value);
ImGui::SetTooltip(alt_value.c_str()); ImGui::SetTooltip("%s", alt_value.c_str());
} }
return any_changed; return any_changed;
} }
@@ -697,7 +697,7 @@ bool DebugWindow::DrawRegisterTextBox(int id, uint64_t* value) {
auto alt_value = state_.register_input_hex auto alt_value = state_.register_input_hex
? std::to_string(*value) ? std::to_string(*value)
: string_util::to_hex_string(*value); : string_util::to_hex_string(*value);
ImGui::SetTooltip(alt_value.c_str()); ImGui::SetTooltip("%s", alt_value.c_str());
} }
return any_changed; return any_changed;
} }
@@ -736,7 +736,7 @@ bool DebugWindow::DrawRegisterTextBox(int id, double* value) {
auto alt_value = state_.register_input_hex auto alt_value = state_.register_input_hex
? std::to_string(*value) ? std::to_string(*value)
: string_util::to_hex_string(*value); : string_util::to_hex_string(*value);
ImGui::SetTooltip(alt_value.c_str()); ImGui::SetTooltip("%s", alt_value.c_str());
} }
return any_changed; return any_changed;
} }
@@ -779,7 +779,7 @@ bool DebugWindow::DrawRegisterTextBoxes(int id, float* value) {
auto alt_value = state_.register_input_hex auto alt_value = state_.register_input_hex
? std::to_string(value[i]) ? std::to_string(value[i])
: string_util::to_hex_string(value[i]); : string_util::to_hex_string(value[i]);
ImGui::SetTooltip(alt_value.c_str()); ImGui::SetTooltip("%s", alt_value.c_str());
} }
if (i < 3) { if (i < 3) {
ImGui::SameLine(); ImGui::SameLine();
@@ -1067,9 +1067,9 @@ void DebugWindow::DrawThreadsPane() {
ImGui::Dummy(ImVec2(8, 0)); ImGui::Dummy(ImVec2(8, 0));
ImGui::SameLine(); ImGui::SameLine();
if (frame.guest_function) { if (frame.guest_function) {
ImGui::Text(frame.guest_function->name().c_str()); ImGui::Text("%s", frame.guest_function->name().c_str());
} else { } else {
ImGui::Text(frame.name); ImGui::Text("%s", frame.name);
} }
if (is_current_thread && !frame.guest_pc) { if (is_current_thread && !frame.guest_pc) {
ImGui::PopStyleColor(); ImGui::PopStyleColor();
@@ -1259,7 +1259,7 @@ void DebugWindow::DrawBreakpointsPane() {
ImGui::SameLine(); ImGui::SameLine();
ImGui::Dummy(ImVec2(4, 0)); ImGui::Dummy(ImVec2(4, 0));
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text(export_entry->name); ImGui::Text("%s", export_entry->name);
ImGui::Dummy(ImVec2(0, 1)); ImGui::Dummy(ImVec2(0, 1));
ImGui::PopID(); ImGui::PopID();
} }