dd

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

commit e2faeb8b021f6aa74e5b610c8cf01f1593de6fdf
parent 91afd6c8629f5a1607ce678069061cdcd07f0551
Author: ssnf <ssnf@ssnf.xyz>
Date:   Sat, 17 Jul 2021 08:22:15 +0000

unfucked a retardation

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

diff --git a/dd.c b/dd.c @@ -51,17 +51,15 @@ main(int argc, char* argv[]) } } buf = malloc(bs); - if (count) - goto count; - while (n = fread(buf, 1, bs, in)) - fwrite(buf, 1, n, out); - goto exit; -count: - for (;count--;) { - n = fread(buf, 1, bs, in); - fwrite(buf, 1, n, out); + if (!count) { + for (;n = fread(buf, 1, bs, in);) + fwrite(buf, 1, n, out); + } else { + for (;count--;) { + fread(buf, 1, bs, in); + fwrite(buf, 1, bs, out); + } } -exit: fclose(in); fclose(out); }