usr/fileio/common.c: Suppress a compiler warning

Avoid that gcc 8 complains about the strncpy() call.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8257 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-04-20 15:53:53 +00:00
parent 3002ba7652
commit 07e936a256
+3 -1
View File
@@ -996,9 +996,11 @@ static void exec_inquiry(struct vdisk_cmd *vcmd)
resp_len = buf[3] + 6;
} else if (0x80 == cmd->cdb[2]) { /* unit serial number */
int usn_len = strlen(dev->usn);
buf[1] = 0x80;
buf[3] = usn_len;
strncpy((char *)&buf[4], dev->usn, usn_len);
assert(4 + usn_len <= sizeof(buf));
memcpy(&buf[4], dev->usn, usn_len);
resp_len = buf[3] + 4;
} else if (0x83 == cmd->cdb[2]) { /* device identification */
int num = 4;