From: Laurent Mazet Date: Mon, 16 Jan 2023 15:31:32 +0000 (+0100) Subject: correct output X-Git-Url: https://secure.softndesign.org/git/?p=hexdump.git;a=commitdiff_plain;h=60e280f7d78237f814fce15da7c60afb23b8e621 correct output --- diff --git a/hexdump.c b/hexdump.c index 9c90d21..8a08561 100644 --- a/hexdump.c +++ b/hexdump.c @@ -87,7 +87,7 @@ void printline (char *buffer, int nb, unsigned long int addr) { printf ("0x%0*lx:", nbdigits, addr); for (i = 0; i < nb; i++) { - printf (" %02x", buffer[i]); + printf (" %02x", (unsigned char)buffer[i]); } for (i = nb; i < nbcols; i++) { printf (" "); @@ -755,5 +755,6 @@ int main (int argc, char *argv[]) // test: hexdump.exe -i hexdump.c -e ' s//' 2>&1 | grep -q 'erroneous pattern' // test: hexdump.exe -i hexdump.c -e ' s/\x41BCD/2041/' 2>&1 | grep -q "can't find pattern" // test: hexdump.exe -i hexdump.c -e ' s/cflags/414e5/' 2>&1 | grep -q 'erroneous sequence' +// test: hexdump.exe -i hexdump.exe | grep -q 'ffff'; test x$? = x1 /* vim: set ts=4 sw=4 et: */