2013-12-17 18:19:04 +00:00
|
|
|
/*
|
2018-08-16 14:53:05 +01:00
|
|
|
* Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
|
2013-12-17 18:19:04 +00:00
|
|
|
*
|
2017-05-03 09:38:09 +01:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2013-12-17 18:19:04 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int puts(const char *s)
|
|
|
|
{
|
|
|
|
int count = 0;
|
2018-08-16 14:53:05 +01:00
|
|
|
|
2018-08-23 15:11:46 +01:00
|
|
|
while (*s != '\0') {
|
|
|
|
if (putchar(*s) == EOF)
|
2018-03-06 16:23:28 +00:00
|
|
|
return EOF;
|
2018-08-23 15:11:46 +01:00
|
|
|
s++;
|
2018-03-06 16:23:28 +00:00
|
|
|
count++;
|
2013-12-17 18:19:04 +00:00
|
|
|
}
|
2013-12-12 16:46:30 +00:00
|
|
|
|
2018-03-06 16:23:28 +00:00
|
|
|
if (putchar('\n') == EOF)
|
|
|
|
return EOF;
|
2013-12-12 16:46:30 +00:00
|
|
|
|
2018-03-06 16:23:28 +00:00
|
|
|
return count + 1;
|
2013-12-17 18:19:04 +00:00
|
|
|
}
|