diff options
-rw-r--r-- | libbb/dump.c | 6 | ||||
-rwxr-xr-x | testsuite/hexdump.tests | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/libbb/dump.c b/libbb/dump.c index b406a2428..2ca9919da 100644 --- a/libbb/dump.c +++ b/libbb/dump.c | |||
@@ -198,9 +198,11 @@ static NOINLINE void rewrite(priv_dumper_t *dumper, FS *fs) | |||
198 | if (!e) | 198 | if (!e) |
199 | goto DO_BAD_CONV_CHAR; | 199 | goto DO_BAD_CONV_CHAR; |
200 | pr->flags = F_INT; | 200 | pr->flags = F_INT; |
201 | if (e > int_convs + 1) /* not d or i? */ | ||
202 | pr->flags = F_UINT; | ||
203 | byte_count_str = "\010\004\002\001"; | 201 | byte_count_str = "\010\004\002\001"; |
202 | if (e > int_convs + 1) { /* not d or i? */ | ||
203 | pr->flags = F_UINT; | ||
204 | byte_count_str++; | ||
205 | } | ||
204 | goto DO_BYTE_COUNT; | 206 | goto DO_BYTE_COUNT; |
205 | } else | 207 | } else |
206 | if (strchr(int_convs, *p1)) { /* %d etc */ | 208 | if (strchr(int_convs, *p1)) { /* %d etc */ |
diff --git a/testsuite/hexdump.tests b/testsuite/hexdump.tests index be0379cfc..517ec508b 100755 --- a/testsuite/hexdump.tests +++ b/testsuite/hexdump.tests | |||
@@ -82,4 +82,10 @@ testing "hexdump -e /2 %d" \ | |||
82 | "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"\ | 82 | "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"\ |
83 | "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"\ | 83 | "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"\ |
84 | 84 | ||
85 | testing "hexdump -n4 -e '\"%u\"'" \ | ||
86 | "hexdump -n4 -e '\"%u\"'" \ | ||
87 | "12345678" \ | ||
88 | "" \ | ||
89 | "\x4e\x61\xbc\x00AAAA" | ||
90 | |||
85 | exit $FAILCOUNT | 91 | exit $FAILCOUNT |