Skip to content
Snippets Groups Projects
Commit 9936e16b authored by Hauke Mehrtens's avatar Hauke Mehrtens
Browse files

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: default avatarHauke Mehrtens <hauke@hauke-m.de>
parent beed86e6
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=io
PKG_RELEASE:=2
PKG_RELEASE:=3
include $(INCLUDE_DIR)/package.mk
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment