Therefore, you may be getting the return values mixed up. In this case the function is going to return false (0) when there is a match and true (!0) when not a match. Although you may expect it to work the opposite way but that is not the case due the return value complexity for non-matches.