Re: [PATCH next 5/8] test_hexdump: Fix sample output if zero bytes requested

From: David Laight
Date: Wed Mar 12 2025 - 15:40:37 EST


On Mon, 10 Mar 2025 11:03:07 +0200
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:

> On Sat, Mar 08, 2025 at 09:34:49AM +0000, David Laight wrote:
> > If 'len' is zero the expected output is an empty string even if
> > 'ascii' is requested.
>
> It's related to the previous one...
> So, seems to me the series need a bit more (re-)thinking...
>

Nope, all its own bug.
This is a request to hexdump zero bytes into a valid buffer size.
hex_dump_to_buffer() gets it right unless the output buffer length
is also zero.

Found when I started doing a full range of tests.

David