dd

C89 implementation of dd
git clone git://ssnf.xyz/dd
Log | Files | Refs

commit 1f2f60207407a4556b3fac0fabfc87ef945383c8
parent 353b5c2d6d9aef05e311074b2942f45f0d598978
Author: ssnf <ssnf@ssnf.xyz>
Date:   Mon, 12 Jul 2021 06:44:51 +0000

simplified code

Diffstat:
Mdd.c | 8++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/dd.c b/dd.c @@ -25,8 +25,8 @@ main(int argc, char* argv[]) char* buf; uint bs, count, i, n; - in = out = NULL; - buf = NULL; + in = stdin; + out = stdout; bs = 512; count = 0; for (i = 1; i < argc; ++i) { @@ -51,10 +51,6 @@ main(int argc, char* argv[]) } } buf = malloc(bs); - if (!in) - in = stdin; - if (!out) - out = stdout; if (count) goto count; while (n = fread(buf, 1, bs, in))