Android: Fix the build of the 'sg' engine
authorBart Van Assche <bvanassche@acm.org>
Tue, 4 Oct 2022 19:22:00 +0000 (12:22 -0700)
committerBart Van Assche <bvanassche@acm.org>
Tue, 4 Oct 2022 19:38:03 +0000 (12:38 -0700)
Fix the following compiler error:

engines/sg.c:1337:46: error: argument type 'void' is incomplete
                                snprintf(msgchunk, MAXMSGCHUNK, " %02x", hdr->sbp[i]);

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
engines/sg.c

index 72ee07ba4592f715618e935bf57712246bce8ac0..24783374cba3086a72bb530a7ed854a2ca4a8a17 100644 (file)
@@ -1331,10 +1331,12 @@ static char *fio_sgio_errdetails(struct io_u *io_u)
                        strlcat(msg, ". ", MAXERRDETAIL);
                }
                if (hdr->sb_len_wr) {
+                       const uint8_t *const sbp = hdr->sbp;
+
                        snprintf(msgchunk, MAXMSGCHUNK, "Sense Data (%d bytes):", hdr->sb_len_wr);
                        strlcat(msg, msgchunk, MAXERRDETAIL);
                        for (i = 0; i < hdr->sb_len_wr; i++) {
-                               snprintf(msgchunk, MAXMSGCHUNK, " %02x", hdr->sbp[i]);
+                               snprintf(msgchunk, MAXMSGCHUNK, " %02x", sbp[i]);
                                strlcat(msg, msgchunk, MAXERRDETAIL);
                        }
                        strlcat(msg, ". ", MAXERRDETAIL);