Hi Dominique!

On Do, 28 Jul 2011, Dominique Pellé wrote:

> It is safe without checking (STRLEN(IObuff) >= 3) because
> the  C operator '&&' short-circuits. So if length is 0 for example,
> then the tests...
> 
>  +         && IObuff[0] == 0xef
>  +         && IObuff[1] == 0xbb
>  +         && IObuff[2] == 0xbf)
> 
> ... stop as soon as it finds IObuff[0] being end of string (NUL)
> since it's different than 0xef, it it never evaluates IObuff[1] or
> IObuff[2].  See:
> 
> http://en.wikipedia.org/wiki/Short-circuit_evaluation


Ah, okay. Thanks.

regards,
Christian
-- 

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui