← Commit list

a165603d2

Ron Yorston
Ron Yorston
2017-07-19
SUCCESS Duration: 146s

Subject

od_bloaty: fix floating point output

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/od_bloaty.c+2 -1
@@ -665,7 +665,7 @@ decode_one_format(const char *s_orig, const char *s, struct tspec *tspec)
fmt = FLOATING_POINT;
++s;
p = strchr(FDL, *s);
- if (!p) {
+ if (!p || *p == '\0') {
size = sizeof(double);
if (isdigit(s[0])) {
size = bb_strtou(s, &end, 0);
@@ -686,6 +686,7 @@ decode_one_format(const char *s_orig, const char *s, struct tspec *tspec)
};
size = FDL_sizeof[p - FDL];
+ s++; /* skip F/D/L */
}
size_spec = fp_type_size[size];
testsuite/od.tests+10 -0
@@ -16,6 +16,16 @@ testing "od -b" \
"" "HELLO"
SKIP=
+optional DESKTOP
+testing "od -f" \
+ "od -f" \
+"\
+0000000 0.0000000e+00 0.0000000e+00
+0000010
+" \
+ "" "\x00\x00\x00\x00\x00\x00\x00\x00"
+SKIP=
+
optional DESKTOP LONG_OPTS
testing "od -b --traditional" \
"od -b --traditional" \