Re: [PATCH] VTL emulation, no barcodes shown in mtx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi,

attached patch should fix this regression.

On Wed, Jan 06, 2021 at 11:08:05PM +0100, Michael Ablassmeier wrote:
>  > commit 73cb8f355479d8f7cb402ca967b137d4a32c8f76
>  > Author: FUJITA Tomonori <tomof@xxxxxxx>
>  > Date:   Fri Jul 28 11:34:15 2017 +0900
>  >     smc: fix snprintf warnings with gcc7
> 
> i reverted both commits and removed -WAll from the makefile to be
> able to compile, and now mtx show the barcodes:
> 
>  >  Storage Changer /dev/sg8:1 Drives, 8 Slots ( 0 Import/Export )
>  >  Data Transfer Element 0:Empty
>  >        Storage Element 1:Full :VolumeTag=TAPE001                        
>  >        Storage Element 2:Full :VolumeTag=TAPE002  
> 
> 
> bye,
>     - michael
diff --git a/usr/smc.c b/usr/smc.c
index bbc7b7f..5efcbd7 100644
--- a/usr/smc.c
+++ b/usr/smc.c
@@ -184,7 +184,7 @@ static int add_element_descriptor(uint8_t *data, struct slot *s,
 		{
 			char buf[sizeof(attr->scsi_sn) + 1];
 			memset(buf, 0, sizeof(buf));
-			snprintf(buf, sizeof(buf), "%-s", attr->scsi_sn);
+			snprintf(buf, sizeof(buf), "%-10s", attr->scsi_sn);
 			memcpy((char *)&data[i + 28], buf, 10);
 		}
 	}

[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux