X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=udev_utils_file.c;h=e4d5802ff899824b6960a7369e150108c6d66dd9;hp=9bf60696d94ed74d9ddd79d5b854e918154dc1c2;hb=27d4bf1817259873b0a1e118d03978f0d2f2595e;hpb=fbda4babec842382d704eb41b2040d73ad995886 diff --git a/udev_utils_file.c b/udev_utils_file.c index 9bf60696d..e4d5802ff 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, '/');