X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=hexdump.c;h=8a085616731ce23ec2e92cb4aa4636c43c62feb5;hb=60e280f7d78237f814fce15da7c60afb23b8e621;hp=9c90d21c921cdd45f4fc5e2ed563b3ba0f5aa8d9;hpb=a2b7edd4e8fb7a8ae9b561701b1cc75b677baa22;p=hexdump.git 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: */