busybox/coreutils
Ron Yorston a165603d24 od_bloaty: fix floating point output
Currently od_bloaty does this:

   $ /bin/echo -en '\x00\x00\x00\x00\x00\x00\x00\x00' | busybox od -f
   od: invalid character 'F' in type string 'fF'
   $ /bin/echo -en '\x00\x00\x00\x00\x00\x00\x00\x00' | busybox od -t fD
   od: invalid character 'D' in type string 'fD'
   $ /bin/echo -en '\x00\x00\x00\x00\x00\x00\x00\x00' | busybox od -t f
   0000000
   0000010

The first two occur because the alphabetic length specifier isn't being
properly skipped.  The third is due to the empty length specifier being
treated as alphabetic so we fall off the end of the FDL_sizeof array with
undetermined consequences.  Coreutils defaults to printing a double in
this case.

With this patch the output is:

   $ /bin/echo -en '\x00\x00\x00\x00\x00\x00\x00\x00' | ./busybox od -f
   0000000   0.0000000e+00   0.0000000e+00
   0000010
   $ /bin/echo -en '\x00\x00\x00\x00\x00\x00\x00\x00' | ./busybox od -t fD
   0000000   0.000000000000000e+00
   0000010
   $ /bin/echo -en '\x00\x00\x00\x00\x00\x00\x00\x00' | ./busybox od -t f
   0000000   0.000000000000000e+00
   0000010

I guess nobody uses BusyBox od to print floating point numbers.

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-19 13:12:02 +02:00
..
libcoreutils libbb: more compact API for bb_parse_mode() 2015-10-07 17:55:33 +02:00
basename.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
cat.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
chgrp.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
chmod.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
chown.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
chroot.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
cksum.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
comm.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
Config.src Big cleanup in config help and description 2017-01-10 14:58:54 +01:00
cp.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
cut.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
date.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
dd.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
df.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
dirname.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
dos2unix.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
du.c Convert all coreutils/* applets to "new style" applet definitions 2016-11-23 14:46:56 +01:00
echo.c shells: make hush test optional, rename ASH_BUILTIN_foo -> ASH_foo 2017-01-10 15:13:30 +01:00
env.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
expand.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
expr.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
factor.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
false.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
fold.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
fsync.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
head.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
hostid.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
id_test.sh
id.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
install.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
Kbuild.src shells: make hush test optional, rename ASH_BUILTIN_foo -> ASH_foo 2017-01-10 15:13:30 +01:00
link.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
ln.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
logname.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
ls.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
md5_sha1_sum.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
mkdir.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
mkfifo.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
mknod.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
mktemp.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
mv.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
nice.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
nl.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
nohup.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
nproc.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
od_bloaty.c od_bloaty: fix floating point output 2017-07-19 13:12:02 +02:00
od.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
paste.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
printenv.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
printf.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
pwd.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
readlink.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
realpath.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
rm.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
rmdir.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
seq.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
shred.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
shuf.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
sleep.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
sort.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
split.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
stat.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
stty.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
sum.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
sync.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
tac.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
tail.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
tee.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
test_ptr_hack.c *: make GNU licensing statement forms more regular 2010-08-16 20:14:46 +02:00
test.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
timeout.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
touch.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
tr.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
true.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
truncate.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
tty.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
uname.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
uniq.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
unlink.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
usleep.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
uudecode.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
uuencode.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
wc.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
who.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
whoami.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00
yes.c Update menuconfig items with approximate applet sizes 2017-07-18 22:01:24 +02:00