]> granicus.if.org Git - strace/blobdiff - scsi.c
io.c: move sendfile parsers to a separate file
[strace] / scsi.c
diff --git a/scsi.c b/scsi.c
index 1daf088423e0967d262ddd7055b9c75eafd03c0b..9038c3c9a56785d28f6829ae9d8e9d08b1e20723 100644 (file)
--- 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]);