Skip to content

Commit 9c576e7

Browse files
ikegami-tigaw
authored andcommitted
wdc: fix muon build warning
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]>
1 parent 5cf7282 commit 9c576e7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

plugins/wdc/wdc-nvme.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5374,9 +5374,9 @@ static void wdc_print_unsupported_reqs_log_json(struct wdc_ocp_C5_unsupported_re
53745374

53755375
json_object_add_value_int(root, "Number Unsupported Req IDs", le16_to_cpu(log_data->unsupported_count));
53765376

5377-
char unsup_req_list_str[40];
5377+
char unsup_req_list_str[41];
53785378

5379-
memset((void *)unsup_req_list_str, 0, 40);
5379+
memset((void *)unsup_req_list_str, 0, 41);
53805380
for (j = 0; j < le16_to_cpu(log_data->unsupported_count); j++) {
53815381
sprintf((char *)unsup_req_list_str, "Unsupported Requirement List %d", j);
53825382
json_object_add_value_string(root, unsup_req_list_str, (char *)log_data->unsupported_req_list[j]);

0 commit comments

Comments
 (0)