mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
[CodeQuality]Fix C++ static analyzer findings (#29745)
* [PVS] Fix static analyzer findings * f: fix error handling * f: more improvements * Update src/modules/FileLocksmith/FileLocksmithLibInterop/NtdllExtensions.cpp
This commit is contained in:
@@ -238,7 +238,7 @@ void FancyZonesSettings::LoadSettings()
|
||||
if (auto val = values.get_int_value(NonLocalizable::OverlappingZonesAlgorithmID))
|
||||
{
|
||||
// Avoid undefined behavior
|
||||
if (*val >= 0 || *val < static_cast<int>(OverlappingZonesAlgorithm::EnumElements))
|
||||
if (*val >= 0 && *val < static_cast<int>(OverlappingZonesAlgorithm::EnumElements))
|
||||
{
|
||||
auto algorithm = (OverlappingZonesAlgorithm)*val;
|
||||
if (m_settings.overlappingZonesAlgorithm != algorithm)
|
||||
|
||||
Reference in New Issue
Block a user