Using the && relational operator with an actual C compiler would be a pretty hard bug to find. You should use the bitwise & operator which will get you the intended result.
I would also highly recommend that you examine carefully the compiler's assembly language output to verify that it is doing what you want it to do.