Use strchrnul to simplify chomping the password string when read from terminal.