use safer strncmp()