mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 07:23:33 +08:00
libvsprintf: fixed handling of "%f" to print precision 6
This commit is contained in:
@@ -1215,7 +1215,7 @@ int lib_vsprintf(FAR struct lib_outstream_s *obj, FAR const char *src, va_list a
|
|||||||
fmt = FMT_RJUST;
|
fmt = FMT_RJUST;
|
||||||
width = 0;
|
width = 0;
|
||||||
#ifdef CONFIG_LIBC_FLOATINGPOINT
|
#ifdef CONFIG_LIBC_FLOATINGPOINT
|
||||||
trunc = 0;
|
trunc = 6;
|
||||||
#endif
|
#endif
|
||||||
#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
|
#ifndef CONFIG_NOPRINTF_FIELDWIDTH
|
||||||
fmt = FMT_RJUST0;
|
fmt = FMT_RJUST0;
|
||||||
|
if (IS_HASDOT(flags)) {
|
||||||
|
trunc = 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
|
|||||||
Reference in New Issue
Block a user