comparison of unsigned enum expression >= 0 is always true

This commit is contained in:
Gregory Burd 2012-09-29 13:30:46 -04:00
parent 8ae9d2f294
commit 80ce790881

2
proc.c
View file

@ -442,7 +442,7 @@ procdump(void)
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
if(p->state == UNUSED)
continue;
if(p->state >= 0 && p->state < NELEM(states) && states[p->state])
if(p->state && p->state < NELEM(states) && states[p->state])
state = states[p->state];
else
state = "???";