diff options
Diffstat (limited to 'libsysfs/sysfs_class.c')
-rw-r--r-- | libsysfs/sysfs_class.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libsysfs/sysfs_class.c b/libsysfs/sysfs_class.c index 7a696355ca..59ef0be48e 100644 --- a/libsysfs/sysfs_class.c +++ b/libsysfs/sysfs_class.c @@ -509,16 +509,16 @@ static int get_classdev_path(const char *classname, const char *clsdev, } if (strncmp(classname, SYSFS_BLOCK_NAME, sizeof(SYSFS_BLOCK_NAME)) == 0) { - safestrncat(path, "/", len); - safestrncat(path, SYSFS_BLOCK_NAME, len); + safestrcatmax(path, "/", len); + safestrcatmax(path, SYSFS_BLOCK_NAME, len); } else { - safestrncat(path, "/", len); - safestrncat(path, SYSFS_CLASS_NAME, len); - safestrncat(path, "/", len); - safestrncat(path, classname, len); + safestrcatmax(path, "/", len); + safestrcatmax(path, SYSFS_CLASS_NAME, len); + safestrcatmax(path, "/", len); + safestrcatmax(path, classname, len); } - safestrncat(path, "/", len); - safestrncat(path, clsdev, len); + safestrcatmax(path, "/", len); + safestrcatmax(path, clsdev, len); return 0; } |