mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 03:05:40 +08:00
libc/puts: newline was omitted for empty string
`puts("");` did not print a newline. The standard
behavior is to print a newline even if the string
is empty.
Signed-off-by: liamHowatt <liamjmh0@gmail.com>
This commit is contained in:
@@ -57,7 +57,7 @@ int puts(FAR const IPTR char *s)
|
|||||||
/* Write the string without its trailing '\0' */
|
/* Write the string without its trailing '\0' */
|
||||||
|
|
||||||
nwritten = fputs_unlocked(s, stream);
|
nwritten = fputs_unlocked(s, stream);
|
||||||
if (nwritten > 0)
|
if (nwritten >= 0)
|
||||||
{
|
{
|
||||||
/* Followed by a newline */
|
/* Followed by a newline */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user