logical if in C

rinthesun, what Udo is trying to point out is that you probably meant :

if ((temp == -1) || (temp1 == -1 )) {....

It's a classic mistake and easy to miss when re-checking your code. The fact you misspelt 'if' suggests you did not realise the difference.