summaryrefslogtreecommitdiff
path: root/udev_utils_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'udev_utils_file.c')
-rw-r--r--udev_utils_file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/udev_utils_file.c b/udev_utils_file.c
index 9bf60696d9..e4d5802ff8 100644
--- a/udev_utils_file.c
+++ b/udev_utils_file.c
@@ -65,6 +65,9 @@ int delete_path(const char *path)
strcpy (p, path);
pos = strrchr(p, '/');
+ if (pos == p || pos == NULL)
+ return 0;
+
while (1) {
*pos = '\0';
pos = strrchr(p, '/');