From: Hauke Mehrtens Date: Thu, 7 Nov 2019 21:13:13 +0000 (+0100) Subject: io: Fix printing 4 bytes memory on 64 bit systems X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=9936e16b724b4388204e21e2d4c3f49283d980eb;p=openwrt-packages.git 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 --- diff --git a/utils/io/Makefile b/utils/io/Makefile index fe3f779b2..c572554d0 100644 --- a/utils/io/Makefile +++ b/utils/io/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=io -PKG_RELEASE:=2 +PKG_RELEASE:=3 include $(INCLUDE_DIR)/package.mk diff --git a/utils/io/src/io.c b/utils/io/src/io.c index 519291213..be861e3a2 100644 --- a/utils/io/src/io.c +++ b/utils/io/src/io.c @@ -68,7 +68,7 @@ memread_memory(unsigned long phys_addr, void *addr, int len, int iosize) printf(" %04x", *(unsigned short *)addr); break; case 4: - printf(" %08lx", *(unsigned long *)addr); + printf(" %08x", *(unsigned int *)addr); break; } i += iosize;