Skip to content
Snippets Groups Projects
Commit 4aa6a915 authored by weijiel6's avatar weijiel6
Browse files

fix one argument bug

parent 84c21164
No related branches found
No related tags found
No related merge requests found
Pipeline #2777 failed
...@@ -223,16 +223,18 @@ int main( int argc, char **argv ) ...@@ -223,16 +223,18 @@ int main( int argc, char **argv )
if( argc == 2 ) if( argc == 2 )
{ {
if (isdigit(argc[1]) == 0) { //if (isdigit(argv[1]) == 0) {
fprintf(stderr, "please entre a integer\n"); // fprintf(stderr, "please entre a integer\n");
return 0; // return 0;
} //}
int guess_num = argc[1]; int guess_num = atoi(argv[1]);
FILE *fp; FILE *fp;
char line[10000]; char line[10000];
fp = fopen(argv[1], "r"); fp = fopen("common_passwords.txt", "r");
int secret_num; for(int i = 0; i < guess_num; i++) {
for(int i = 0) get_password(line, fp);
printf("%s\n", line);
}
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment