Browse Source

io: Fix printing 4 bytes memory on 64 bit systems

On 64 bit Linux systems long is 8 bytes long, on 32 bit Linux systems it
is 4 bytes long. Here we want to print 4 bytes and not 8 bytes, use int
instead of long.

This fixes printing 4 bytes on 64 bit systems.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
lilik-openwrt-22.03
Hauke Mehrtens 5 years ago
parent
commit
9936e16b72
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      utils/io/Makefile
  2. +1
    -1
      utils/io/src/io.c

+ 1
- 1
utils/io/Makefile View File

@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=io PKG_NAME:=io
PKG_RELEASE:=2
PKG_RELEASE:=3
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk


+ 1
- 1
utils/io/src/io.c View File

@ -68,7 +68,7 @@ memread_memory(unsigned long phys_addr, void *addr, int len, int iosize)
printf(" %04x", *(unsigned short *)addr); printf(" %04x", *(unsigned short *)addr);
break; break;
case 4: case 4:
printf(" %08lx", *(unsigned long *)addr);
printf(" %08x", *(unsigned int *)addr);
break; break;
} }
i += iosize; i += iosize;


Loading…
Cancel
Save