initialize flag variable to 0 (and continue if GetLogCategory() fails)

pull/10151/head
John Newbery 8 years ago
parent 72bc7e1303
commit cd7f39467a

@ -913,9 +913,10 @@ bool AppInitParameterInteraction()
if (!(GetBoolArg("-nodebug", false) || find(categories.begin(), categories.end(), std::string("0")) != categories.end())) { if (!(GetBoolArg("-nodebug", false) || find(categories.begin(), categories.end(), std::string("0")) != categories.end())) {
for (const auto& cat : categories) { for (const auto& cat : categories) {
uint32_t flag; uint32_t flag = 0;
if (!GetLogCategory(&flag, &cat)) { if (!GetLogCategory(&flag, &cat)) {
InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debug", cat)); InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debug", cat));
continue;
} }
logCategories |= flag; logCategories |= flag;
} }
@ -926,9 +927,10 @@ bool AppInitParameterInteraction()
if (mapMultiArgs.count("-debugexclude") > 0) { if (mapMultiArgs.count("-debugexclude") > 0) {
const std::vector<std::string>& excludedCategories = mapMultiArgs.at("-debugexclude"); const std::vector<std::string>& excludedCategories = mapMultiArgs.at("-debugexclude");
for (const auto& cat : excludedCategories) { for (const auto& cat : excludedCategories) {
uint32_t flag; uint32_t flag = 0;
if (!GetLogCategory(&flag, &cat)) { if (!GetLogCategory(&flag, &cat)) {
InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debugexclude", cat)); InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debugexclude", cat));
continue;
} }
logCategories &= ~flag; logCategories &= ~flag;
} }

Loading…
Cancel
Save