summarylogtreecommitdiffstats
path: root/0001-warnings-fix-format-security-warnings-299.patch
blob: b94a075b63dfb65ce0c74ce1530294b3374beb75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
From d601dfcb711b07fe2c317f64b3f245cf41a35aff Mon Sep 17 00:00:00 2001
From: Russ <russ@rw.id.au>
Date: Wed, 15 Sep 2021 18:02:16 +1000
Subject: [PATCH 1/2] warnings: fix format-security warnings (#299)

---
 source/views/view_help.cpp           | 8 ++++----
 source/views/view_hexeditor.cpp      | 2 +-
 source/views/view_pattern_editor.cpp | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/source/views/view_help.cpp b/source/views/view_help.cpp
index 0f19b27..d33ecb5 100644
--- a/source/views/view_help.cpp
+++ b/source/views/view_help.cpp
@@ -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();
 
diff --git a/source/views/view_hexeditor.cpp b/source/views/view_hexeditor.cpp
index 9ddad85..848ed1f 100644
--- a/source/views/view_hexeditor.cpp
+++ b/source/views/view_hexeditor.cpp
@@ -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);
diff --git a/source/views/view_pattern_editor.cpp b/source/views/view_pattern_editor.cpp
index 3fdd231..87ffe63 100644
--- a/source/views/view_pattern_editor.cpp
+++ b/source/views/view_pattern_editor.cpp
@@ -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]);
-- 
2.33.0