Consistently use printaddr for printing addresses
* bjm.c (SYS_FUNC(init_module)): Use printaddr.
* clone.c (SYS_FUNC(clone)): Likewise.
* evdev.c (ff_effect_ioctl): Likewise.
* mtd.c (decode_mtd_oob_buf): Likewise.
* net.c (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg), SYS_FUNC(getsockopt)):
Likewise.
* print_sigevent.c (print_sigevent): Likewise.
* printsiginfo.c (printsigval, print_si_info): Likewise.
* signal.c (decode_new_sigaction): Likewise.
* sysmips.c (SYS_FUNC(sysmips)): Likewise.
* util.c (printpathn, printstr, umoven_or_printaddr): Likewise.
* v4l2.c (print_v4l2_buffer, print_v4l2_framebuffer,
umoven_or_printaddr_ignore_syserror): Likewise.
* tests/net-icmp_filter.c (main): Update.
Based on patch by Eugene Syromyatnikov <evgsyr@gmail.com>.
diff --git a/util.c b/util.c
index 9c8c978..de881f4 100644
--- a/util.c
+++ b/util.c
@@ -761,7 +761,7 @@
/* Fetch one byte more to find out whether path length > n. */
nul_seen = umovestr(tcp, addr, n + 1, path);
if (nul_seen < 0)
- tprintf("%#lx", addr);
+ printaddr(addr);
else {
path[n++] = '\0';
print_quoted_string(path, n, QUOTE_0_TERMINATED);
@@ -812,7 +812,7 @@
* because string_quote may look one byte ahead.
*/
if (umovestr(tcp, addr, size + 1, str) < 0) {
- tprintf("%#lx", addr);
+ printaddr(addr);
return;
}
style = QUOTE_0_TERMINATED;
@@ -821,7 +821,7 @@
if (size > (unsigned long)len)
size = (unsigned long)len;
if (umoven(tcp, addr, size, str) < 0) {
- tprintf("%#lx", addr);
+ printaddr(addr);
return;
}
style = 0;
@@ -1131,13 +1131,9 @@
umoven_or_printaddr(struct tcb *tcp, const long addr, const unsigned int len,
void *our_addr)
{
- if (!addr) {
- tprints("NULL");
- return -1;
- }
- if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
+ if (!addr || !verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
umoven(tcp, addr, len, our_addr) < 0) {
- tprintf("%#lx", addr);
+ printaddr(addr);
return -1;
}
return 0;