summaryrefslogtreecommitdiff
path: root/nuttx/lib/stdio/lib_libvsprintf.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-05-14 15:21:04 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-05-14 15:21:04 +0000
commitf62084035feaf8b9a22804821b22e2a3c15e6eda (patch)
treee2d1548a5bf0d8e33386a178103c756473b90ad6 /nuttx/lib/stdio/lib_libvsprintf.c
parent6f8fd8927787deda605f6fb070bab21ee4022084 (diff)
downloadpx4-nuttx-f62084035feaf8b9a22804821b22e2a3c15e6eda.tar.gz
px4-nuttx-f62084035feaf8b9a22804821b22e2a3c15e6eda.tar.bz2
px4-nuttx-f62084035feaf8b9a22804821b22e2a3c15e6eda.zip
Implemented line-oriented buffering for std output
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3606 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib/stdio/lib_libvsprintf.c')
-rw-r--r--nuttx/lib/stdio/lib_libvsprintf.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/nuttx/lib/stdio/lib_libvsprintf.c b/nuttx/lib/stdio/lib_libvsprintf.c
index 24591d875..8e0709ec9 100644
--- a/nuttx/lib/stdio/lib_libvsprintf.c
+++ b/nuttx/lib/stdio/lib_libvsprintf.c
@@ -1127,7 +1127,20 @@ int lib_vsprintf(FAR struct lib_outstream_s *obj, const char *src, va_list ap)
if (*src != '%')
{
+ /* Output the character */
+
obj->put(obj, *src);
+
+ /* Flush the buffer if a newline is encountered */
+
+#ifdef CONFIG_STDIO_LINEBUFFER
+ if (*src == '\n')
+ {
+ (void)obj->flush(obj);
+ }
+#endif
+ /* Process the next character in the format */
+
continue;
}