diff options
Diffstat (limited to 'hex.c')
-rw-r--r-- | hex.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -20,13 +20,16 @@ static void Dump(char *fn,FILE *fp) { strcpy(s," "); - printf("%6.6x: ",p); - p+=16; - for(f=0;f<16;f++) { if((b!=EOF)&&((b=getc(fp))!=EOF)) { + if (f == 0) + { + printf("%6.6x: ",p); + p+=16; + } + printf("%2.2x ",(unsigned char)b); if (isprint(b)) @@ -40,6 +43,11 @@ static void Dump(char *fn,FILE *fp) } else { + if (f == 0) + { + return; + } + printf("** "); } } |