Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- main()
- {
- FILE *fp = fopen("user.pswd.txt","r");
- if(fp==NULL)
- {
- printf("file not found.\n");
- exit(EXIT_FAILURE);
- }
- char *first, *last, *bytes, *user, *pass, *line;
- char *username, *password;
- int retry = 3;
- printf("Attempting to login to protected system, please login to your account.\n");
- while(retry)
- {
- printf("username: ");
- scanf("%s", user);
- printf("password: ");
- scanf("%s", pass);
- while(fscanf(fp, "%[^\n]\n", first) != EOF)
- {
- printf("OH MY FUCKIGN GOOOOD PRIIIIIIINT\n");
- printf("\"%s\"\n",first);
- /*
- if(strcmp(user,username) && strcmp(pass,password))
- {
- printf("Hello, %s! You are currently using %dKB of storage.\n", first);
- fclose(fp);
- exit(EXIT_SUCCESS);
- }*/
- }
- printf("Login failed. %d attempts left.\n", --retry);
- }
- fclose(fp);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement