bug#80583: "dd" fails to account for short final write

Collin Funk <[email protected]> Wed, 11 Mar 2026 11:54:36 -0700
Newsgroups gmane.comp.gnu.core-utils.bugs
Message-ID <[email protected]>
Pádraig Brady <[email protected]> writes:

> Thanks for the excellent report and reproducer.
> This looks to be a bug since the original implementation.
> Attached is a fix and test.
>
> Marking this as done.

Thanks for the patch. I had a similar change locally in src/dd.c after
reading the bug.

>                diagnose (errno, _("error writing %s"), quoteaf (output_file));
> +              if (nwritten != 0)
> +                w_partial++;

Minor style thing, but I thought it looked a bit nicer to write:

  w_partial += nwritten != 0;

here and in write_output().

Collin