aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-04-05 11:29:19 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2017-04-05 11:30:10 +0200
commitc7e73eafa139c29a38f73ab697e2e967a386908d (patch)
treeac888603a16e8f987f2e78b7e342498c33d10f00 /src
parent3c95bd43d8ffec336e26227ac4e2d71d3b349061 (diff)
parentcd7f39467afd1f2742a80d608852ebb9eb5179a0 (diff)
Merge #10151: [logging] initialize flag variable to 0 (and continue if GetLogCategory() fails)
cd7f394 initialize flag variable to 0 (and continue if GetLogCategory() fails) (John Newbery) Tree-SHA512: d0f2653bd0e71ed763220cb08d3a5335c5bdfe2f54ff7f9302d97f3265d7aa7f57606fe416a61aaac1535dbb046d0fb40a61f5a9d5cf234b042268e00ee7679d
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 08360e167d..315be8b697 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -910,9 +910,10 @@ bool AppInitParameterInteraction()
if (find(categories.begin(), categories.end(), std::string("0")) == categories.end()) {
for (const auto& cat : categories) {
- uint32_t flag;
+ uint32_t flag = 0;
if (!GetLogCategory(&flag, &cat)) {
InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debug", cat));
+ continue;
}
logCategories |= flag;
}
@@ -923,9 +924,10 @@ bool AppInitParameterInteraction()
if (mapMultiArgs.count("-debugexclude") > 0) {
const std::vector<std::string>& excludedCategories = mapMultiArgs.at("-debugexclude");
for (const auto& cat : excludedCategories) {
- uint32_t flag;
+ uint32_t flag = 0;
if (!GetLogCategory(&flag, &cat)) {
InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debugexclude", cat));
+ continue;
}
logCategories &= ~flag;
}