]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
replaced sizeof with NVML_DEVICE_NAME_BUFFER_SIZE (provided with nvml.h)
authorRobert Dietrich <robert.dietrich@tu-dresden.de>
Thu, 22 Aug 2019 13:00:15 +0000 (15:00 +0200)
committerRobert Dietrich <robert.dietrich@tu-dresden.de>
Thu, 22 Aug 2019 13:00:15 +0000 (15:00 +0200)
src/gpu_nvidia.c

index d072c43fe57d7830aace5d2415bccb4574f3a840..93313f532660e85bd19d42fef3bd21d1d3b0c6ca 100644 (file)
@@ -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