device: Fix not deleting the folder after removing the device
authorTedd Ho-Jeong An <tedd.an@intel.com>
Wed, 8 Jun 2022 05:14:18 +0000 (22:14 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:54 +0000 (14:55 +0530)
This patch fixes the issue not deleting the device folder when the
device is removed.

Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/device.c

index 7c3686c..60f13a0 100644 (file)
@@ -6904,7 +6904,7 @@ static void delete_folder_tree(const char *dirname)
                if (entry->d_type == DT_UNKNOWN)
                        entry->d_type = util_get_dt(dirname, entry->d_name);
 
-               create_filename(filename, PATH_MAX, "%s/%s", dirname,
+               snprintf(filename, PATH_MAX, "%s/%s", dirname,
                                entry->d_name);
 
                if (entry->d_type == DT_DIR)