diff options
-rw-r--r-- | libbb/dump.c | 1 | ||||
-rwxr-xr-x | testsuite/hexdump.tests | 19 |
2 files changed, 19 insertions, 1 deletions
diff --git a/libbb/dump.c b/libbb/dump.c index 920f003ef..7a07d6605 100644 --- a/libbb/dump.c +++ b/libbb/dump.c | |||
@@ -432,7 +432,6 @@ static unsigned char *get(priv_dumper_t *dumper) | |||
432 | if (dumper->pub.dump_vflag != DUP) { | 432 | if (dumper->pub.dump_vflag != DUP) { |
433 | puts("*"); | 433 | puts("*"); |
434 | } | 434 | } |
435 | return NULL; | ||
436 | } | 435 | } |
437 | memset(dumper->get__curp + nread, 0, need); | 436 | memset(dumper->get__curp + nread, 0, need); |
438 | dumper->eaddress = dumper->address + nread; | 437 | dumper->eaddress = dumper->address + nread; |
diff --git a/testsuite/hexdump.tests b/testsuite/hexdump.tests index 45a0c1300..cfb20187e 100755 --- a/testsuite/hexdump.tests +++ b/testsuite/hexdump.tests | |||
@@ -15,4 +15,23 @@ testing 'hexdump -C with four NULs' \ | |||
15 | '' \ | 15 | '' \ |
16 | '\0\0\0\0' | 16 | '\0\0\0\0' |
17 | 17 | ||
18 | testing "hexdump does not think last padded block matches any full block" \ | ||
19 | "hexdump -e '1/1 \"%02x|\"1/1 \"%02x!\\n\"'" \ | ||
20 | "\ | ||
21 | 00|00! | ||
22 | * | ||
23 | 00| ! | ||
24 | " \ | ||
25 | '' \ | ||
26 | '\0\0\0\0\0\0\0\0\0\0\0' | ||
27 | |||
28 | testing "hexdump thinks last full block can match" \ | ||
29 | "hexdump -e '1/1 \"%02x|\"1/1 \"%02x!\\n\"'" \ | ||
30 | "\ | ||
31 | 00|00! | ||
32 | * | ||
33 | " \ | ||
34 | '' \ | ||
35 | '\0\0\0\0\0\0\0\0\0\0\0\0' | ||
36 | |||
18 | exit $FAILCOUNT | 37 | exit $FAILCOUNT |