From: Florian Forster Date: Fri, 18 Apr 2008 05:23:48 +0000 (+0200) Subject: sensors plugin: Fix the return status of `sensors_snprintf_chip_name'. X-Git-Tag: collectd-4.2.7~4 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a67c726a4c669088eb40da491d9d41826e1388a9;p=collectd.git sensors plugin: Fix the return status of `sensors_snprintf_chip_name'. The function should return <0 only if an error occured, but in two out of three branches the initial status of -1 was not modified. This may have rendered the sensors plugin unusable for some people. --- diff --git a/src/sensors.c b/src/sensors.c index 2a0a9ea5..173ed9c1 100644 --- a/src/sensors.c +++ b/src/sensors.c @@ -189,14 +189,14 @@ static int sensors_snprintf_chip_name (char *buf, size_t buf_size, } else if (chip->bus == SENSORS_CHIP_NAME_BUS_DUMMY) { - snprintf (buf, buf_size, "%s-%s-%04x", + status = snprintf (buf, buf_size, "%s-%s-%04x", chip->prefix, chip->busname, chip->addr); } else { - snprintf (buf, buf_size, "%s-i2c-%d-%02x", + status = snprintf (buf, buf_size, "%s-i2c-%d-%02x", chip->prefix, chip->bus, chip->addr);