...
Code Block | ||
---|---|---|
| ||
void login(char *usr, char *pw) { User user = find_User(usr); if (!strcmp((user->password),pw_given)) { grantAccess(); } denyAccess("Incorrect Password"); } |
...
Code Block | ||
---|---|---|
| ||
int check_password(User *user, char *pw_given) { if (!strcmp((user->password),pw_given)) { return 1; } return 0; } void login(char *usr, char *pw) { User user = find_User(usr); if (!check_password(user, pw)) { grantAccess(); } denyAccess("Incorrect Password"); } |
...
Code Block | ||
---|---|---|
| ||
void login(char *usr, char *pw) { User user = find_User(usr); if (strcmp((user->password),pw_given) == 0) { grantAccess(); } denyAccess("Incorrect Password"); } |
...