From: Dmitry V. Levin Date: Fri, 17 Jul 2015 16:00:18 +0000 (+0000) Subject: scsi.c: use printaddr X-Git-Tag: v4.11~421 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8277ec9c6099cd72b4a28037c2eda42591a640c4;p=strace scsi.c: use printaddr * scsi.c (print_sg_io_buffer): Use printaddr. --- diff --git a/scsi.c b/scsi.c index 1daf0884..9038c3c9 100644 --- a/scsi.c +++ b/scsi.c @@ -52,9 +52,9 @@ print_sg_io_buffer(struct tcb *tcp, unsigned long addr, const unsigned int len) if (len == 0) goto out; allocated = (len > max_strlen) ? max_strlen : len; - if ((buf = malloc(allocated)) == NULL || - umoven(tcp, addr, allocated, buf) < 0) { - tprintf("%#lx", addr); + buf = malloc(allocated); + if (!buf || umoven(tcp, addr, allocated, buf) < 0) { + printaddr(addr); goto out; } tprintf("%02x", buf[0]);