Originally Posted by
kingliaho
if (condition) OR (condition) OR (condition)
and the 'false' of each of these conditions returns -1
In C the numerical value of false is zero
and the 'true' returns a positive integer?
The numerical value of true is non-zero so a condition may evaluate to -1 or any negative number but it would be true.
It is upto the coder to do the error checking by testing the conditional evaluation and making their code more robust ie
Code:
if (condition > 0)
/* start here if true */
else
/* if false begin here */