/* * hexify.c * * read a binary file, produce a text (7 bit wide ASCII) file * * generic (thick) version, presumed unix compliant */ /* * 02feb85 pf allow for zero-length records: give a blank line in * hex file. useful for t2b output records. */ #include main(argc,argv) int argc; char **argv; { register int test; /* used to put '\n' after 32 %02x outputs */ register int c; /* the next input char or EOF */ test = 0; while ( (c=getchar()) >= 0 ) { test ++; if ( (!((test)%32)) && (test) ) { putchar('\n'); }; printf("%02x",c&0xFF); }; putchar('\n'); } /* end: hexify.c */