blob: 2a0ca11c62e2315fca8e4ccf75a61613f8676a83 [file] [log] [blame]
Ambroise Vincent4128f9f2019-02-11 13:34:41 +00001/*
2 * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <stdio.h>
8
9int puts(const char *s)
10{
11 int count = 0;
12
13 while (*s != '\0') {
14 if (putchar(*s) == EOF)
15 return EOF;
16 s++;
17 count++;
18 }
19
20 if (putchar('\n') == EOF)
21 return EOF;
22
23 return count + 1;
24}