xref: /rk3399_ARM-atf/lib/libc/puts.c (revision 8bb6de151892f20afcffe7cfa114710e0a47d6c6)
1 /*
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 
9 int puts(const char *s)
10 {
11 	int count = 0;
12 
13 	while (*s) {
14 		if (putchar(*s++) == EOF)
15 			return EOF;
16 		count++;
17 	}
18 
19 	if (putchar('\n') == EOF)
20 		return EOF;
21 
22 	return count + 1;
23 }
24