Created
March 6, 2019 09:19
-
-
Save PabloMansanet/ecf2ff7bd14bfad564154c67643c22df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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