Fix assignment in condition

Corrects the use of assignment operator ('=') rather than boolean ('==') in conditional expression.
Merge pull request #920 from brandt/fix_assignment_in_condition

Fix assignment in condition