Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mad
concierge
Commits
6a3da815
Commit
6a3da815
authored
Jun 10, 2014
by
anthraxx
Browse files
rename my_string to input_str for better naming
parent
ea0b0d95
Changes
1
Hide whitespace changes
Inline
Side-by-side
challenge/challenge.c
View file @
6a3da815
...
...
@@ -5,15 +5,15 @@
int
main
()
{
int
ret
;
size_t
nbytes
=
0
;
char
*
my
_str
ing
=
NULL
;
char
*
input
_str
=
NULL
;
char
*
password
=
"23door42
\n
"
;
puts
(
"Please enter Password: "
);
ret
=
getline
(
&
my
_str
ing
,
&
nbytes
,
stdin
);
ret
=
getline
(
&
input
_str
,
&
nbytes
,
stdin
);
if
(
ret
==
-
1
)
{
puts
(
"Error"
);
}
else
if
(
strcmp
(
my
_str
ing
,
password
)
==
0
)
{
}
else
if
(
strcmp
(
input
_str
,
password
)
==
0
)
{
puts
(
"Success"
);
ret
=
0
;
}
else
{
...
...
@@ -21,6 +21,6 @@ int main() {
ret
=
-
1
;
}
free
(
my
_str
ing
);
free
(
input
_str
);
return
ret
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment