Use NULL, not 0, when comparing a pointer