From a026e09bd576552d7f0eb3de8d8b49604ba103fc Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 3 Sep 2006 13:05:26 +0000 Subject: [PATCH] Chop newline at the end of adapter name. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4138 7894878c-1315-0410-8ee3-d5d059ff63e0 --- lib/sysfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index ed94ebe7..8a77bceb 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -199,7 +199,8 @@ int sensors_read_sysfs_bus(void) if (!(attr = sysfs_get_device_attr(dev, "name"))) continue; - entry.adapter = strdup(attr->value); + /* NB: attr->value[attr->len-1] == '\n'; chop that off */ + entry.adapter = strndup(attr->value, attr->len - 1); if (!entry.adapter) sensors_fatal_error(__FUNCTION__, "out of memory");