Returning NULL instead of false is bad. You're only lucky because NULL is defined as 0.