chiark / gitweb /
use libudev code, unify logging, pass udev context around everywhere
[elogind.git] / udev / udev_utils_string.c
index e3dc137e63257be33471a2d1a8ede3523a281dd4..3bfe22c8150b5aedcf9355124b140918df5a19bb 100644 (file)
@@ -21,6 +21,7 @@
 #include <stdio.h>
 #include <stddef.h>
 #include <unistd.h>
+#include <string.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <ctype.h>
@@ -45,6 +46,8 @@ void remove_trailing_chars(char *path, char c)
 {
        size_t len;
 
+       if (path == NULL)
+               return;
        len = strlen(path);
        while (len > 0 && path[len-1] == c)
                path[--len] = '\0';