chiark / gitweb /
[PATCH] remove limit of the number of args passed to PROGRAM
[elogind.git] / udev.h
diff --git a/udev.h b/udev.h
index fa56c366911a511e15fed9b2b5bb8e05633ad994..3b676acf40d99ab1a7a137dbbe49804b80f6ecde 100644 (file)
--- a/udev.h
+++ b/udev.h
@@ -90,7 +90,7 @@ static inline char *get_action(void)
        char *action;
 
        action = getenv("ACTION");
-       if (strlen(action) > ACTION_SIZE)
+       if (action != NULL && strlen(action) > ACTION_SIZE)
                action[ACTION_SIZE-1] = '\0';
 
        return action;
@@ -101,7 +101,7 @@ static inline char *get_devpath(void)
        char *devpath;
 
        devpath = getenv("DEVPATH");
-       if (strlen(devpath) > DEVPATH_SIZE)
+       if (devpath != NULL && strlen(devpath) > DEVPATH_SIZE)
                devpath[DEVPATH_SIZE-1] = '\0';
 
        return devpath;
@@ -118,7 +118,7 @@ static inline char *get_seqnum(void)
 
 static inline char *get_subsystem(char *subsystem)
 {
-       if (strlen(subsystem) > SUBSYSTEM_SIZE)
+       if (subsystem != NULL && strlen(subsystem) > SUBSYSTEM_SIZE)
                subsystem[SUBSYSTEM_SIZE-1] = '\0';
 
        return subsystem;