Skip to content

Commit

Permalink
initialize flag variable to 0 (and continue if GetLogCategory() fails)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnewbery committed Apr 4, 2017
1 parent 72bc7e1 commit cd7f394
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -913,9 +913,10 @@ bool AppInitParameterInteraction()

if (!(GetBoolArg("-nodebug", false) || 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;
}
Expand All @@ -926,9 +927,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;
}
Expand Down

0 comments on commit cd7f394

Please sign in to comment.