refactor correct_password.c to avoid one if