Compare commits

...

1 Commits

2 changed files with 10 additions and 2 deletions

View File

@@ -2057,13 +2057,18 @@ void DoSrvPrivateModifyLinesImpl(const size_t count, const bool insert)
coordDestination.X = 0;
if (insert)
{
coordDestination.Y = (cursorPosition.Y) + gsl::narrow<short>(count);
coordDestination.Y = cursorPosition.Y + base::MakeClampedNum(count);
}
else
{
coordDestination.Y = (cursorPosition.Y) - gsl::narrow<short>(count);
coordDestination.Y = (cursorPosition.Y) - base::MakeClampedNum(count);
}
// The destination needs to still be inside the buffer.
// We will take anything that is "too big" of a line modification and clamp it down to
// the maximum modification that is possible in our buffer size.
screenInfo.GetBufferSize().Clamp(coordDestination);
// Note the revealed lines are filled with the standard erase attributes.
LOG_IF_FAILED(DoSrvPrivateScrollRegion(screenInfo,
srScroll,

View File

@@ -69,7 +69,10 @@
#include <CppCoreCheck/Warnings.h>
// Chromium Numerics (safe math)
#pragma warning(push)
#pragma warning(disable:4100)
#include <base/numerics/safe_math.h>
#pragma warning(pop)
// IntSafe
#define ENABLE_INTSAFE_SIGNED_FUNCTIONS