Skip to content

Commit cd7f394

Browse files
committed
initialize flag variable to 0 (and continue if GetLogCategory() fails)
1 parent 72bc7e1 commit cd7f394

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/init.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,9 +913,10 @@ bool AppInitParameterInteraction()
913913

914914
if (!(GetBoolArg("-nodebug", false) || find(categories.begin(), categories.end(), std::string("0")) != categories.end())) {
915915
for (const auto& cat : categories) {
916-
uint32_t flag;
916+
uint32_t flag = 0;
917917
if (!GetLogCategory(&flag, &cat)) {
918918
InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debug", cat));
919+
continue;
919920
}
920921
logCategories |= flag;
921922
}
@@ -926,9 +927,10 @@ bool AppInitParameterInteraction()
926927
if (mapMultiArgs.count("-debugexclude") > 0) {
927928
const std::vector<std::string>& excludedCategories = mapMultiArgs.at("-debugexclude");
928929
for (const auto& cat : excludedCategories) {
929-
uint32_t flag;
930+
uint32_t flag = 0;
930931
if (!GetLogCategory(&flag, &cat)) {
931932
InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debugexclude", cat));
933+
continue;
932934
}
933935
logCategories &= ~flag;
934936
}

0 commit comments

Comments
 (0)