On Fri, Oct 31, 2003 at 03:20:40PM +0100, Matthias Biel wrote:
> [EMAIL PROTECTED] wrote:
> 
> >We should instead of while(!count) or while(count != 0) Always use 
> >expressions
> >like while(count > 0), because ">' operator provides safe exit from 
> >loop...
> 
> unsigned variables ?!
> 

It is better to not let the author in the position he must think
is he using unsigned or signed variables

If we e.g. know that count is always less than 1000, then this is
IMHO a very safe way to do loops that are aiming at stable code
and are proof to input junk data:

if(count < 1000)
  for(; --count > 0; )
  { 
    /* hackers_code which can crash the kernel if the
    ** count is negative (when signed) or larger than 1000
    */ 
  }

Emard


-- 
Info:
To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe linux-dvb" as 
subject.

Reply via email to