chiark / gitweb /
add $name substitution
[elogind.git] / udevinfo.c
index d0b1c447f4d65f2692b026996333dbf58f8f0328..be9aa769e10f46352039dbdb93e0d723d5dc89d6 100644 (file)
@@ -79,6 +79,8 @@ static void print_all_attributes(const char *devpath, const char *key)
                        if (attr_value == NULL)
                                continue;
                        len = strlcpy(value, attr_value, sizeof(value));
+                       if(len >= sizeof(value))
+                               len = sizeof(value) - 1;
                        dbg("attr '%s'='%s'(%zi)", dent->d_name, value, len);
 
                        /* remove trailing newlines */