summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCore
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2021-09-09 17:06:15 +0200
committerLinus Groh <mail@linusgroh.de>2021-09-11 15:16:26 +0100
commit2e4ec891dadb49965f9de900082d2fd3e52a6577 (patch)
treec56eab743ccaa2b8e643b5dc59b71c7348080bda /Userland/Libraries/LibCore
parent7dfecbee4471d9e34b9a8f099479ff30f145ea4e (diff)
downloadserenity-2e4ec891dadb49965f9de900082d2fd3e52a6577.zip
Everywhere: Fix format-vulnerabilities
Command used: grep -Pirn '(out|warn)ln\((?!["\)]|format,|stderr,|stdout,|output, ")' \ AK Kernel/ Tests/ Userland/ (Plus some manual reviewing.) Let's pick ArgsParser as an example: outln(file, m_general_help); This will fail at runtime if the general help happens to contain braces. Even if this transformation turns out to be unnecessary in a place or two, this way the code is "more obviously" correct.
Diffstat (limited to 'Userland/Libraries/LibCore')
-rw-r--r--Userland/Libraries/LibCore/ArgsParser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCore/ArgsParser.cpp b/Userland/Libraries/LibCore/ArgsParser.cpp
index 54a362331f..dfb027e276 100644
--- a/Userland/Libraries/LibCore/ArgsParser.cpp
+++ b/Userland/Libraries/LibCore/ArgsParser.cpp
@@ -201,7 +201,7 @@ void ArgsParser::print_usage(FILE* file, const char* argv0)
if (m_general_help != nullptr && m_general_help[0] != '\0') {
outln(file, "\nDescription:");
- outln(file, m_general_help);
+ outln(file, "{}", m_general_help);
}
if (!m_options.is_empty())