mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-21 11:39:31 +00:00
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
This commit is contained in:
1 parent
3478493d21
commit
a026e09bd5
1 file changed
+2
-1
+2
-1
@@ -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");
|
||||
|
||||
|
||||
Reference in new issue
Block a user