aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libc/puts.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/puts.c')
-rw-r--r--lib/libc/puts.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/puts.c b/lib/libc/puts.c
index 717b5228e..2a0ca11c6 100644
--- a/lib/libc/puts.c
+++ b/lib/libc/puts.c
@@ -10,9 +10,10 @@ int puts(const char *s)
{
int count = 0;
- while (*s) {
- if (putchar(*s++) == EOF)
+ while (*s != '\0') {
+ if (putchar(*s) == EOF)
return EOF;
+ s++;
count++;
}