rename my_string to input_str for better naming
This commit is contained in:
parent
ea0b0d95e6
commit
6a3da8153d
|
@ -5,15 +5,15 @@
|
|||
int main() {
|
||||
int ret;
|
||||
size_t nbytes = 0;
|
||||
char *my_string = NULL;
|
||||
char *input_str = NULL;
|
||||
char *password = "23door42\n";
|
||||
|
||||
puts("Please enter Password: ");
|
||||
ret = getline(&my_string, &nbytes, stdin);
|
||||
ret = getline(&input_str, &nbytes, stdin);
|
||||
|
||||
if (ret == -1) {
|
||||
puts("Error");
|
||||
} else if (strcmp(my_string, password) == 0) {
|
||||
} else if (strcmp(input_str, password) == 0) {
|
||||
puts("Success");
|
||||
ret = 0;
|
||||
} else {
|
||||
|
@ -21,6 +21,6 @@ int main() {
|
|||
ret = -1;
|
||||
}
|
||||
|
||||
free(my_string);
|
||||
free(input_str);
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue