--- tcpdump-3.4a5-orig/tcpdump.c Sat May 30 12:23:33 1998 +++ tcpdump-3.4a5/tcpdump.c Tue Dec 15 15:26:36 1998 @@ -405,22 +406,31 @@ void default_print_unaligned(register const u_char *cp, register u_int length) { - register u_int i, s; - register int nshorts; + register u_int i,offs=0; - nshorts = (u_int) length / sizeof(u_short); - i = 0; - while (--nshorts >= 0) { - if ((i++ % 8) == 0) - (void)printf("\n\t\t\t"); - s = *cp++; - (void)printf(" %02x%02x", s, *cp++); - } - if (length & 1) { - if ((i % 8) == 0) - (void)printf("\n\t\t\t"); - (void)printf(" %02x", *cp); - } +#define prBYTES 16 + + while (length) { + printf("\n%5u=$%04X: ",offs,offs); + for (i=0;i=0x20 && cp[i]<0x7F) putchar(cp[i]); + else putchar('.'); + length-=i; + cp+=i; + offs+=i; +// For trailing ASCII space padding (too wide!) +#if 0 + while (i++= 0) { - if ((i++ % 8) == 0) - (void)printf("\n\t\t\t"); - (void)printf(" %04x", ntohs(*sp++)); - } - if (length & 1) { - if ((i % 8) == 0) - (void)printf("\n\t\t\t"); - (void)printf(" %02x", *(u_char *)sp); - } + default_print_unaligned(bp, length); } __dead void