rename my_string to input_str for better naming

This commit is contained in:
anthraxx 2014-06-10 13:03:34 +02:00
parent ea0b0d95e6
commit 6a3da8153d

View file

@ -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() {
ret = -1; ret = -1;
} }
free(my_string); free(input_str);
return ret; return ret;
} }