Skip to content

Conversation

@ikegami-t
Copy link
Contributor

Change the string length to 41 from 40 for the warning below.

[165/166] linking unit/test-uint128
../plugins/wdc/wdc-nvme.c: In function 'wdc_print_unsupported_reqs_log_json': ../plugins/wdc/wdc-nvme.c:5381:71: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
sprintf((char *)unsup_req_list_str, "Unsupported Requirement List %d", j);
^
../plugins/wdc/wdc-nvme.c:5381:3: note: 'sprintf' output between 31 and 41 bytes into a destination of size 40
sprintf((char *)unsup_req_list_str, "Unsupported Requirement List %d", j);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change the string length to 41 from 40 for the warning below.

[165/166] linking unit/test-uint128
../plugins/wdc/wdc-nvme.c: In function 'wdc_print_unsupported_reqs_log_json':
../plugins/wdc/wdc-nvme.c:5381:71: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
   sprintf((char *)unsup_req_list_str, "Unsupported Requirement List %d", j);
                                                                       ^
../plugins/wdc/wdc-nvme.c:5381:3: note: 'sprintf' output between 31 and 41 bytes into a destination of size 40
   sprintf((char *)unsup_req_list_str, "Unsupported Requirement List %d", j);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Tokunori Ikegami <[email protected]>
@igaw igaw merged commit 9c576e7 into linux-nvme:master May 19, 2025
16 of 17 checks passed
@igaw
Copy link
Collaborator

igaw commented May 19, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants