From 8277ec9c6099cd72b4a28037c2eda42591a640c4 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Fri, 17 Jul 2015 16:00:18 +0000 Subject: [PATCH] scsi.c: use printaddr * scsi.c (print_sg_io_buffer): Use printaddr. --- scsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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]); -- 2.40.0