splunk / collectd-plugins

SAI x Collectd: https://docs.splunk.com/Documentation/InfraApp/latest/Admin/ManageAgents
13 stars 6 forks source link

‘strncpy’ specified bound 128 equals destination size #4

Closed bashgrylls closed 3 years ago

bashgrylls commented 4 years ago

OS: Fedora 31

make check-TESTS command ends with this error.

src/write_splunk_test.c: In function ‘test_splunk_transforms’: src/write_splunk_test.c:201:7: error: ‘strncpy’ specified bound 128 equals destination size [-Werror=stringop-truncation] 201 | strncpy(vl.plugin_instance, cases[i].plugin_instance, | ^~~~~~~~~~~~~ 202 | sizeof(vl.plugin_instance)); | ~~~~~~~ src/write_splunk_test.c:204:7: error: ‘strncpy’ specified bound 128 equals destination size [-Werror=stringop-truncation] 204 | strncpy(vl.type, cases[i].type, sizeof(vl.type)); | ^~~~~~~~~~~~ src/write_splunk_test.c:206:7: error: ‘strncpy’ specified bound 128 equals destination size [-Werror=stringop-truncation] 206 | strncpy(vl.type_instance, cases[i].type_instance, | ^~~~~~~~~~~~~ 207 | sizeof(vl.type_instance)); | ~~~~~ cc1: all warnings being treated as errors