mirror of
https://github.com/CTCaer/switch-l4t-atf.git
synced 2024-12-01 05:40:27 +00:00
Merge pull request #1311 from jonathanwright-ARM/jw/MISRA-EOF-usage
stdlib: remove comparison with EOF macro to comply with MISRA
This commit is contained in:
commit
fbdadd015d
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user