X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev_utils_file.c;h=e4d5802ff899824b6960a7369e150108c6d66dd9;hb=9d534c0e764a6d2c20032d130e40e867133af149;hp=6a046e822da596ab310f124c18e0e415096e4509;hpb=2362eea6019e07a2e79e67ebe626bfacf40ff40f;p=elogind.git diff --git a/udev_utils_file.c b/udev_utils_file.c index 6a046e822..e4d5802ff 100644 --- a/udev_utils_file.c +++ b/udev_utils_file.c @@ -1,6 +1,4 @@ /* - * udev_utils_file.c - files operations - * * Copyright (C) 2004-2005 Kay Sievers * * This program is free software; you can redistribute it and/or modify it @@ -14,7 +12,7 @@ * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ @@ -67,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, '/');