diff --git a/tdump.c b/tdump.c index 7c85f61..12dfc8a 100644 --- a/tdump.c +++ b/tdump.c @@ -1,5 +1,5 @@ -/* DUMP.C - Dumps stdin To stdout In Hexadecimal Format - Copyright (C) 1986-2020, T.A. Daneliuk +/* tdump - Dumps stdin To stdout In Hexadecimal Format + Copyright (C) 1986-2020, T.A. Daneliuk */ #include @@ -23,13 +23,13 @@ { -int c,count; -char array[4],equiv[WIDTH+1]; -array[2]=' '; -array[3]='\0'; -equiv[WIDTH]='\0'; -count=WIDTH+1; -dl(); + int c,count; + char array[4],equiv[WIDTH+1]; + array[2]=' '; + array[3]='\0'; + equiv[WIDTH]='\0'; + count=WIDTH+1; + dl(); while ((c=getc(stdin)) != EOF) { @@ -58,13 +58,11 @@ void dl() { - -tohex2((int) (line & 0xffL),&lineno[4]); -tohex2((int) ((line >> 8) & 0xffL),&lineno[2]); -tohex2((int) ((line >> 16) & 0xffl),&lineno[0]); -fputs(lineno,stdout); -fputs(" => ",stdout); - + tohex2((int) (line & 0xffL),&lineno[4]); + tohex2((int) ((line >> 8) & 0xffL),&lineno[2]); + tohex2((int) ((line >> 16) & 0xffl),&lineno[0]); + fputs(lineno,stdout); + fputs(" => ",stdout); } /*********************** Display ASCII Equivalents **************************/ @@ -74,11 +72,11 @@ char *equiv; { -fputs(" | ",stdout); -fputs(equiv,stdout); -fputs(" |\n",stdout); -line=line + 0x10; -return(WIDTH); + fputs(" | ",stdout); + fputs(equiv,stdout); + fputs(" |\n",stdout); + line=line + 0x10; + return(WIDTH); } @@ -101,15 +99,15 @@ { -int temp; -static char conv[]={"0123456789ABCDEF"}; + int temp; + static char conv[]={"0123456789ABCDEF"}; -temp=i; -temp=temp & 0x000f; /* Mask all but low nybble */ -array[1]=conv[temp]; /* Use to index into conversion table */ -temp=i; /* Now do high nybble */ -temp=temp >> 4; -temp=temp & 0x000f; -array[0]=conv[temp]; + temp=i; + temp=temp & 0x000f; /* Mask all but low nyble */ + array[1]=conv[temp]; /* Use to index into conversion table */ + temp=i; /* Now do high nyble */ + temp=temp >> 4; + temp=temp & 0x000f; + array[0]=conv[temp]; }