diff options
author | Rob Landley <rob@landley.net> | 2020-04-07 21:05:06 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-04-07 21:05:06 -0500 |
commit | 8a27c1e48c7aca1c6b095f224135b4485b697bd3 (patch) | |
tree | 6ee123c9e9d8b4dd057c2cc2da181436b24df749 | |
parent | 9d084c8ffc5e6442efcb2ec2d8f069475f8bd060 (diff) | |
download | toybox-8a27c1e48c7aca1c6b095f224135b4485b697bd3.tar.gz |
Minor cleanup.
-rw-r--r-- | toys/lsb/md5sum.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/toys/lsb/md5sum.c b/toys/lsb/md5sum.c index 65346675..f57996c6 100644 --- a/toys/lsb/md5sum.c +++ b/toys/lsb/md5sum.c @@ -345,7 +345,7 @@ static void do_hash(int fd, char *name) else do_builtin_hash(fd, name); if (name) - printf((toys.optflags & FLAG_b) ? "%s\n" : "%s %s\n", toybuf, name); + printf(FLAG(b) ? "%s\n" : "%s %s\n", toybuf, name); } static int do_c_line(char *line) @@ -410,10 +410,12 @@ void md5sum_main(void) // Calculate table if we have floating point. Static version should drop // out at compile time when we don't need it. - if (CFG_TOYBOX_FLOAT) { - TT.md5table = xmalloc(64*4); - for (i = 0; i<64; i++) TT.md5table[i] = fabs(sin(i+1))*(1LL<<32); - } else TT.md5table = md5nofloat; + if (toys.which->name[0]=='m') { + if (CFG_TOYBOX_FLOAT) { + TT.md5table = xmalloc(64*4); + for (i = 0; i<64; i++) TT.md5table[i] = fabs(sin(i+1))*(1LL<<32); + } else TT.md5table = md5nofloat; + } if (FLAG(c)) for (arg = toys.optargs; *arg; arg++) do_c_file(*arg); else { |