Skip to content

Commit

Permalink
Fixed static analysis issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianPanov committed Oct 10, 2024
1 parent 6cb888d commit d8316b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lwlog/src/details/pattern/formatter_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ namespace lwlog::details

const auto& [verbose, shortened] = flags;
while (std::strstr(pattern.data(), verbose.data()))
{
pattern.replace(pattern.find(verbose), verbose.length(), str_value);
}

while (std::strstr(pattern.data(), shortened.data()))
{
pattern.replace(pattern.find(shortened), shortened.length(), str_value);
}
}

template<typename T>
Expand All @@ -35,6 +39,8 @@ namespace lwlog::details
}();

while (std::strstr(pattern.data(), flag.data()))
{
pattern.replace(pattern.find(flag), flag.length(), str_value);
}
}
}
4 changes: 2 additions & 2 deletions lwlog/src/sinks/sink_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ namespace lwlog::sinks
case level::error: return "\u001b[31;1m";
case level::critical: return "\u001b[41;1m";
case level::debug: return "\u001b[37;1m";
case level::all: return {};
case level::none: return {};
case level::all: return "";
case level::none: return "";
}
});
}
Expand Down

0 comments on commit d8316b4

Please sign in to comment.