Commit 6a3da815 authored by anthraxx's avatar anthraxx
Browse files

rename my_string to input_str for better naming

parent ea0b0d95
...@@ -5,15 +5,15 @@ ...@@ -5,15 +5,15 @@
int main() { int main() {
int ret; int ret;
size_t nbytes = 0; size_t nbytes = 0;
char *my_string = NULL; char *input_str = NULL;
char *password = "23door42\n"; char *password = "23door42\n";
puts("Please enter Password: "); puts("Please enter Password: ");
ret = getline(&my_string, &nbytes, stdin); ret = getline(&input_str, &nbytes, stdin);
if (ret == -1) { if (ret == -1) {
puts("Error"); puts("Error");
} else if (strcmp(my_string, password) == 0) { } else if (strcmp(input_str, password) == 0) {
puts("Success"); puts("Success");
ret = 0; ret = 0;
} else { } else {
...@@ -21,6 +21,6 @@ int main() { ...@@ -21,6 +21,6 @@ int main() {
ret = -1; ret = -1;
} }
free(my_string); free(input_str);
return ret; return ret;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment