summaryrefslogtreecommitdiff
path: root/libsysfs/sysfs_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'libsysfs/sysfs_driver.c')
-rw-r--r--libsysfs/sysfs_driver.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libsysfs/sysfs_driver.c b/libsysfs/sysfs_driver.c
index 0011177e99..1877dbce0b 100644
--- a/libsysfs/sysfs_driver.c
+++ b/libsysfs/sysfs_driver.c
@@ -182,7 +182,9 @@ static int get_driver_path(const unsigned char *bus, const unsigned char *drv,
dprintf("Error getting sysfs mount path\n");
return -1;
}
- strcat(path, SYSFS_BUS_DIR);
+ if (sysfs_trailing_slash(path) == 0)
+ strcat(path, "/");
+ strcat(path, SYSFS_BUS_NAME);
strcat(path, "/");
strcat(path, bus);
strcat(path, SYSFS_DRIVERS_DIR);