chiark / gitweb /
Fix virtio-ports rule to use $attr instead of $ATTR
[elogind.git] / libudev / libudev-device.c
index 71fc775242e81ccad7f3cc930bd772f0649adbe0..b841745991effca0a32ac69ee7b1d70c36129d3f 100644 (file)
@@ -1089,7 +1089,7 @@ struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device
 
 struct udev_list_entry *udev_device_add_property_from_string(struct udev_device *udev_device, const char *property)
 {
-       char name[UTIL_PATH_SIZE];
+       char name[UTIL_LINE_SIZE];
        char *val;
 
        util_strscpy(name, sizeof(name), property);
@@ -1166,7 +1166,9 @@ static int update_envp_monitor_buf(struct udev_device *udev_device)
                l = util_strpcpyl(&s, l, key, "=", udev_list_entry_get_value(list_entry), NULL);
                if (l == 0)
                        return -EINVAL;
+               /* advance past the trailing '\0' that util_strpcpyl() guarantees */
                s++;
+               l--;
        }
        udev_device->envp[i] = NULL;
        udev_device->monitor_buf_len = s - udev_device->monitor_buf;