Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
fbdadd01
Unverified
Commit
fbdadd01
authored
Mar 22, 2018
by
davidcunado-arm
Committed by
GitHub
Mar 22, 2018
Browse files
Merge pull request #1311 from jonathanwright-ARM/jw/MISRA-EOF-usage
stdlib: remove comparison with EOF macro to comply with MISRA
parents
ff48086b
5ea28277
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/stdlib/puts.c
View file @
fbdadd01
...
...
@@ -9,23 +9,17 @@
int
puts
(
const
char
*
s
)
{
int
count
=
0
;
while
(
*
s
)
{
if
(
putchar
(
*
s
++
)
!=
EOF
)
{
count
++
;
}
else
{
count
=
EOF
;
break
;
}
while
(
*
s
)
{
if
(
putchar
(
*
s
++
)
==
EOF
)
return
EOF
;
count
++
;
}
/* According to the puts(3) manpage, the function should write a
* trailing newline.
*/
if
((
count
!=
EOF
)
&&
(
putchar
(
'\n'
)
!=
EOF
))
count
++
;
else
count
=
EOF
;
if
(
putchar
(
'\n'
)
==
EOF
)
return
EOF
;
return
count
;
return
count
+
1
;
}
Write
Preview
Markdown
is supported
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