aboutsummaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2013-04-25 22:22:45 +1000
committerAndrew Tridgell <tridge@samba.org>2013-05-04 19:18:35 +1000
commit953acbe65014e2b2305c4338ca3711622fda3fdd (patch)
tree32403dbecacf597cba11ac1058c298c90e4de034 /nuttx
parenta153ee529f68e9b52805b8c77da1ec2bf0e54210 (diff)
downloadpx4-firmware-953acbe65014e2b2305c4338ca3711622fda3fdd.tar.gz
px4-firmware-953acbe65014e2b2305c4338ca3711622fda3fdd.tar.bz2
px4-firmware-953acbe65014e2b2305c4338ca3711622fda3fdd.zip
libvsprintf: fixed handling of "%f" to print precision 6
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/libc/stdio/lib_libvsprintf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/nuttx/libc/stdio/lib_libvsprintf.c b/nuttx/libc/stdio/lib_libvsprintf.c
index 9a391610d..3d26ff810 100644
--- a/nuttx/libc/stdio/lib_libvsprintf.c
+++ b/nuttx/libc/stdio/lib_libvsprintf.c
@@ -1215,7 +1215,7 @@ int lib_vsprintf(FAR struct lib_outstream_s *obj, FAR const char *src, va_list a
fmt = FMT_RJUST;
width = 0;
#ifdef CONFIG_LIBC_FLOATINGPOINT
- trunc = 0;
+ trunc = 6;
#endif
#endif
@@ -1245,6 +1245,9 @@ int lib_vsprintf(FAR struct lib_outstream_s *obj, FAR const char *src, va_list a
{
#ifndef CONFIG_NOPRINTF_FIELDWIDTH
fmt = FMT_RJUST0;
+ if (IS_HASDOT(flags)) {
+ trunc = 0;
+ }
#endif
}
#if 0