vhost-user-scsi: fix printf format warning
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 28 Aug 2019 08:18:06 +0000 (12:18 +0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 17 Dec 2019 18:32:47 +0000 (19:32 +0100)
Fixes:
../contrib/vhost-user-scsi/vhost-user-scsi.c:118:57: error: format specifies
      type 'unsigned char' but the argument has type 'int' [-Werror,-Wformat]
    g_warning("Unable to determine cdb len (0x%02hhX)", cdb[0] >> 5);

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
contrib/vhost-user-scsi/vhost-user-scsi.c

index 0fc14d7899b6e9e6b54b53f7ded8537390a55b07..7a1db164c84b2052356ed4fdc86127f355fec7c0 100644 (file)
@@ -115,7 +115,7 @@ static int get_cdb_len(uint8_t *cdb)
     case 4: return 16;
     case 5: return 12;
     }
-    g_warning("Unable to determine cdb len (0x%02hhX)", cdb[0] >> 5);
+    g_warning("Unable to determine cdb len (0x%02hhX)", (uint8_t)(cdb[0] >> 5));
     return -1;
 }