diff options
author | px4dev <px4@purgatory.org> | 2012-10-10 23:43:57 -0700 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2012-10-11 00:22:22 -0700 |
commit | 674b6552364ac1d66e9fd13c72c74c90f1a15d69 (patch) | |
tree | fa003fb68b28d6ad24f32f7977f478e892dee213 /nuttx/lib/stdio/lib_libdtoa.c | |
parent | ec018e7b6468553eacb0e23af1fd7dac39749ef7 (diff) | |
download | px4-firmware-674b6552364ac1d66e9fd13c72c74c90f1a15d69.tar.gz px4-firmware-674b6552364ac1d66e9fd13c72c74c90f1a15d69.tar.bz2 px4-firmware-674b6552364ac1d66e9fd13c72c74c90f1a15d69.zip |
Quick hack to print floating-point numbers that are powers of 10 less wrongly.
Diffstat (limited to 'nuttx/lib/stdio/lib_libdtoa.c')
-rw-r--r-- | nuttx/lib/stdio/lib_libdtoa.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/nuttx/lib/stdio/lib_libdtoa.c b/nuttx/lib/stdio/lib_libdtoa.c index 1e022a8eb..667c49c53 100644 --- a/nuttx/lib/stdio/lib_libdtoa.c +++ b/nuttx/lib/stdio/lib_libdtoa.c @@ -224,8 +224,15 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec, for (i = expt; i > 0; i--) { - obj->put(obj, *digits); - digits++; + if (*digits != '\0') + { + obj->put(obj, *digits); + digits++; + } + else + { + obj->put(obj, '0'); + } } /* Get the length of the fractional part */ |