mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
target: change sprintf to snprintf in transport_dump_vpd_ident
"buf" is 128 characters and "vpd->device_identifier" is 256. It makes the static checkers complain. Also bump VPD_TMP_BUF_SIZE to match INQUIRY_VPD_DEVICE_IDENTIFIER_LEN. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
This commit is contained in:
parent
8f67835f1e
commit
703d641d87
2 changed files with 7 additions and 4 deletions
|
|
@ -907,15 +907,18 @@ int transport_dump_vpd_ident(
|
|||
|
||||
switch (vpd->device_identifier_code_set) {
|
||||
case 0x01: /* Binary */
|
||||
sprintf(buf, "T10 VPD Binary Device Identifier: %s\n",
|
||||
snprintf(buf, sizeof(buf),
|
||||
"T10 VPD Binary Device Identifier: %s\n",
|
||||
&vpd->device_identifier[0]);
|
||||
break;
|
||||
case 0x02: /* ASCII */
|
||||
sprintf(buf, "T10 VPD ASCII Device Identifier: %s\n",
|
||||
snprintf(buf, sizeof(buf),
|
||||
"T10 VPD ASCII Device Identifier: %s\n",
|
||||
&vpd->device_identifier[0]);
|
||||
break;
|
||||
case 0x03: /* UTF-8 */
|
||||
sprintf(buf, "T10 VPD UTF-8 Device Identifier: %s\n",
|
||||
snprintf(buf, sizeof(buf),
|
||||
"T10 VPD UTF-8 Device Identifier: %s\n",
|
||||
&vpd->device_identifier[0]);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Reference in a new issue