Don't compare a boolean to an integer

This avoids a warning when building with MSVC.
Merge pull request #782 from mstorsjo/fix-msvc-warning

Don't compare a boolean to an integer