From: Robert Dietrich Date: Thu, 22 Aug 2019 13:00:15 +0000 (+0200) Subject: replaced sizeof with NVML_DEVICE_NAME_BUFFER_SIZE (provided with nvml.h) X-Git-Tag: collectd-5.11.0~5^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a781da2ac6afe4aa697d33758c9cbb2acac3e6e;p=thirdparty%2Fcollectd.git replaced sizeof with NVML_DEVICE_NAME_BUFFER_SIZE (provided with nvml.h) --- diff --git a/src/gpu_nvidia.c b/src/gpu_nvidia.c index d072c43fe..93313f532 100644 --- a/src/gpu_nvidia.c +++ b/src/gpu_nvidia.c @@ -174,7 +174,7 @@ static int nvml_read(void) { char dev_name[NVML_DEVICE_NAME_BUFFER_SIZE] = {0}; if( instance_by & INSTANCE_BY_GPUNAME ) { - TRY(nvmlDeviceGetName(dev, dev_name, sizeof(dev_name) - 1)); + TRY(nvmlDeviceGetName(dev, dev_name, NVML_DEVICE_NAME_BUFFER_SIZE)); } // Try to be as lenient as possible with the variety of devices that are