diff options
author | Dimitris Papastamos <dimitris.papastamos@arm.com> | 2018-08-30 16:55:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-30 16:55:05 +0100 |
commit | f60a5004acabccf573e0eb943cdbfad7d7f540f6 (patch) | |
tree | 13d08f9f1a47f8fd736f4780db190bcf3fa00734 /lib/libc/puts.c | |
parent | dcf95e7e90a990d13cd19be6f3d2f9e0fdb87df4 (diff) | |
parent | 5a22e461b5841795c592a08b14c949c46c74e261 (diff) |
Merge pull request #1546 from antonio-nino-diaz-arm/an/log-misra
Fix some MISRA defect in log helpers
Diffstat (limited to 'lib/libc/puts.c')
-rw-r--r-- | lib/libc/puts.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/puts.c b/lib/libc/puts.c index 717b5228..2a0ca11c 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++; } |