Merge r7446 from trunk

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@7699 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2018-11-04 04:29:30 +00:00
parent 89bc3c6e69
commit 496c494c54

View File

@@ -4141,12 +4141,14 @@ static int vdisk_usn_vpd(uint8_t *buf, struct scst_cmd *cmd,
read_lock(&vdisk_serial_rwlock);
usn_len = strlen(virt_dev->usn);
buf[3] = usn_len;
#pragma GCC diagnostic push
#if __GNUC__ -0 >= 8
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
#endif
strncpy(&buf[4], virt_dev->usn, usn_len);
#if __GNUC__ -0 >= 8
#pragma GCC diagnostic pop
#endif
read_unlock(&vdisk_serial_rwlock);
}
return buf[3] + 4;