Last active
July 8, 2017 18:35
-
-
Save zeldani/4c4f9af6d6a105a9eaf218714f307753 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#include <string.h> | |
#include <stdio.h> | |
int login(char *password) { | |
int auth_flag = 0; | |
char buffer[16]; | |
strcpy(buffer, password); | |
if (strcmp(buffer,"zeldani") == 0) | |
auth_flag = 1; | |
return auth_flag; | |
} | |
int main(int argc, char *argv[]) { | |
if(login(argv[1])){ | |
printf("\nWelcome! :)\n"); | |
} else { | |
printf("\nAccess Denied.\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment