Fix underflow/segfault from negative ctypes and debug text

This commit is contained in:
Simon 2011-03-24 20:08:44 +00:00
parent 82d0d63be9
commit bb0907bc96

View File

@ -2856,7 +2856,7 @@ int main(int argc, char *argv[])
if (DEBUG_MODE) if (DEBUG_MODE)
{ {
int tctype = parts[cr>>8].ctype; int tctype = parts[cr>>8].ctype;
if (tctype>=PT_NUM || (cr&0xFF)==PT_PHOT) if (tctype>=PT_NUM || tctype<0 || (cr&0xFF)==PT_PHOT)
tctype = 0; tctype = 0;
if ((cr&0xFF)==PT_PIPE) if ((cr&0xFF)==PT_PIPE)
{ {