File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/cascadia/TerminalCore Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -262,7 +262,7 @@ bool Terminal::PushGraphicsRendition(const ::Microsoft::Console::VirtualTerminal
262
262
else
263
263
{
264
264
// Save everything.
265
- if (( _numSgrPushes < _countof (_storedSgrAttributes)) && (_numSgrPushes >= 0 ))
265
+ if (_numSgrPushes < _countof (_storedSgrAttributes))
266
266
{
267
267
_storedSgrAttributes[_numSgrPushes] = _buffer->GetCurrentAttributes ();
268
268
}
@@ -275,11 +275,14 @@ bool Terminal::PushGraphicsRendition(const ::Microsoft::Console::VirtualTerminal
275
275
276
276
bool Terminal::PopGraphicsRendition ()
277
277
{
278
- _numSgrPushes--;
279
-
280
- if ((_numSgrPushes < _countof (_storedSgrAttributes)) && (_numSgrPushes >= 0 ))
278
+ if (_numSgrPushes > 0 )
281
279
{
282
- _buffer->SetCurrentAttributes (_storedSgrAttributes[_numSgrPushes]);
280
+ _numSgrPushes--;
281
+
282
+ if (_numSgrPushes < _countof (_storedSgrAttributes))
283
+ {
284
+ _buffer->SetCurrentAttributes (_storedSgrAttributes[_numSgrPushes]);
285
+ }
283
286
}
284
287
285
288
return true ;
You can’t perform that action at this time.
0 commit comments