[CRIU] [crtools-bot] hex_dump(): fix address printing
Cyrill Gorcunov
gorcunov at openvz.org
Tue Jan 31 08:19:00 EST 2012
The commit is pushed to "master" and will appear on git://github.com/cyrillos/crtools.git
------>
commit 6c1e5978c4163736c862bcd355bf8b99c8ec9f17
Author: Kir Kolyshkin <kir at openvz.org>
Date: Tue Jan 31 17:17:19 2012 +0400
hex_dump(): fix address printing
- Fix printing the same address on every line (ie p+i, not p).
- Use GNU %p to print pointer, to avoid messing with width etc.
Side effect: 0x is added, hope that's ok.
Signed-off-by: Kir Kolyshkin <kir at openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
util.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/util.c b/util.c
index 72252b6..2cd16c0 100644
--- a/util.c
+++ b/util.c
@@ -55,8 +55,8 @@ void hex_dump(void *addr, unsigned long len)
len = (len + 8) & ~7;
for (i = 0; i < len; i += 8) {
- printk("%08lx: %02x %02x %02x %02x %02x %02x %02x %02x\n",
- (long)p, p[i+0], p[i+1], p[i+2], p[i+3],
+ printk("%p: %02x %02x %02x %02x %02x %02x %02x %02x\n",
+ &p[i], p[i+0], p[i+1], p[i+2], p[i+3],
p[i+4], p[i+5], p[i+6], p[i+7]);
}
}
More information about the CRIU
mailing list