Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
void check(char *password)
{
size_t password_length;
char character_test;
uint char_counter;
int accumulator;
int number_from_char;
accumulator = 0;
char_counter = 0;
while( true ) {
password_length = strlen(password);
if (password_length <= char_counter) {
printf("Password Incorrect!\n");
return;
}
character_test = password[char_counter];
sscanf(&character_test,"%d",&number_from_char);
accumulator = accumulator + number_from_char;
if (accumulator == 0xf) break;
char_counter = char_counter + 1;
}
printf("Password OK!\n");
/* WARNING: Subroutine does not return */
exit(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.