Append Rena's answer to exercise c8-1
Use setpwent and replace the unsecure strcmp by strncmp