Add sanity check panic for CRTC interactions

This commit is contained in:
Nathaniel Wesley Filardo 2015-11-07 00:38:40 -05:00 committed by Frans Kaashoek
parent b019ac4f7d
commit 02530a4859

View file

@ -143,6 +143,9 @@ cgaputc(int c)
if(pos > 0) --pos;
} else
crt[pos++] = (c&0xff) | 0x0700; // black on white
if(pos > 25*80)
panic("pos overflow");
if((pos/80) >= 24){ // Scroll up.
memmove(crt, crt+80, sizeof(crt[0])*23*80);