- else if (size == 2) {
- ushort hword1 = *(ushort *)addr1;
- ushort hword2 = *(ushort *)addr2;
- if (hword1 != hword2) {
- printf("halfword at 0x%08lx (0x%04x) "
- "!= halfword at 0x%08lx (0x%04x)\n",
- addr1, hword1, addr2, hword2);
- rcode = 1;
- break;
- }
- }
- else {
- u_char byte1 = *(u_char *)addr1;
- u_char byte2 = *(u_char *)addr2;
- if (byte1 != byte2) {
- printf("byte at 0x%08lx (0x%02x) "
- "!= byte at 0x%08lx (0x%02x)\n",
- addr1, byte1, addr2, byte2);
- rcode = 1;
- break;
- }
+ if (word1 != word2) {
+ printf("%s at 0x%08lx (%#0*lx) != %s at 0x%08lx (%#0*lx)\n",
+ type, addr1, size, word1,
+ type, addr2, size, word2);
+ rcode = 1;
+ break;