summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon <simon@hardwired.org.uk>2011-03-24 20:08:44 (GMT)
committer Simon <simon@hardwired.org.uk>2011-03-24 20:08:44 (GMT)
commitbb0907bc96316565c3582580bc0af3c09844bb26 (patch)
treecf274e8826ffc33ce54899d8f79d8b5c1bbf25db /src
parent82d0d63be9b940998849d1e58573ad7aa920b27e (diff)
downloadpowder-bb0907bc96316565c3582580bc0af3c09844bb26.zip
powder-bb0907bc96316565c3582580bc0af3c09844bb26.tar.gz
Fix underflow/segfault from negative ctypes and debug text
Diffstat (limited to 'src')
-rw-r--r--src/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index caf7bdb..2a0d8fe 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2856,7 +2856,7 @@ int main(int argc, char *argv[])
if (DEBUG_MODE)
{
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;
if ((cr&0xFF)==PT_PIPE)
{