warnings: fix format-security warnings (#299)

This commit is contained in:
Russ 2021-09-15 18:02:16 +10:00 committed by GitHub
parent d3fb00d441
commit e1f410ceff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -17,7 +17,7 @@ namespace hex {
static void drawTitle(const std::string &title) {
ImGui::TextColored(ImVec4(0.6F, 0.6F, 1.0F, 1.0F), title.c_str());
ImGui::TextColored(ImVec4(0.6F, 0.6F, 1.0F, 1.0F), "%s", title.c_str());
}
static void drawBuiltinFunction(
@ -27,9 +27,9 @@ namespace hex {
const std::string &description
) {
ImGui::Bullet();
ImGui::TextColored(ImVec4(0.3F, 0.7F, 0.2F, 1.0F), return_type.c_str());
ImGui::TextColored(ImVec4(0.3F, 0.7F, 0.2F, 1.0F), "%s", return_type.c_str());
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.57F, 0.24F, 0.69F, 1.0F), name.c_str());
ImGui::TextColored(ImVec4(0.57F, 0.24F, 0.69F, 1.0F), "%s", name.c_str());
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.71F, 0.19F, 0.31F, 1.0F), "(");
ImGui::SameLine();
@ -77,7 +77,7 @@ namespace hex {
constexpr const char* Links[] = { "https://werwolv.net/donate", "https://www.patreon.com/werwolv", "https://github.com/sponsors/WerWolv" };
ImGui::TextWrapped("hex.view.help.about.thanks"_lang);
ImGui::TextWrapped("%s", static_cast<const char *>("hex.view.help.about.thanks"_lang));
ImGui::NewLine();

View File

@ -308,7 +308,7 @@ namespace hex {
if (ImGui::BeginPopupModal("hex.view.hexeditor.script.title"_lang, nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
ImGui::SetCursorPosX(10);
ImGui::TextWrapped("hex.view.hexeditor.script.desc"_lang);
ImGui::TextWrapped("%s", static_cast<const char *>("hex.view.hexeditor.script.desc"_lang));
ImGui::NewLine();
ImGui::InputText("##nolabel", this->m_loaderScriptScriptPath.data(), this->m_loaderScriptScriptPath.length(), ImGuiInputTextFlags_ReadOnly);

View File

@ -268,7 +268,7 @@ namespace hex {
void ViewPatternEditor::drawAlwaysVisible() {
if (ImGui::BeginPopupModal("hex.view.pattern.accept_pattern"_lang, nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
ImGui::TextWrapped("hex.view.pattern.accept_pattern.desc"_lang);
ImGui::TextWrapped("%s", static_cast<const char *>("hex.view.pattern.accept_pattern.desc"_lang));
std::vector<std::string> entries;
entries.resize(this->m_possiblePatternFiles.size());
@ -286,7 +286,7 @@ namespace hex {
}, &entries, entries.size(), 4);
ImGui::NewLine();
ImGui::Text("hex.view.pattern.accept_pattern.question"_lang);
ImGui::Text("%s", static_cast<const char *>("hex.view.pattern.accept_pattern.question"_lang));
confirmButtons("hex.common.yes"_lang, "hex.common.no"_lang, [this]{
this->loadPatternFile(this->m_possiblePatternFiles[this->m_selectedPatternFile]);