chiark / gitweb /
libbudev-private: rename udev_list_entry_get_flag()
[elogind.git] / libudev / libudev-device.c
index 71fc775242e81ccad7f3cc930bd772f0649adbe0..aec5fb57fe01eda57e502585a5e274c15e66fcac 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * libudev - interface to udev device information
  *
- * Copyright (C) 2008-2009 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2008-2010 Kay Sievers <kay.sievers@vrfy.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -1068,7 +1068,7 @@ int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink
        if (list_entry == NULL)
                return -ENOMEM;
        if (unique)
-               udev_list_entry_set_flag(list_entry, 1);
+               udev_list_entry_set_flags(list_entry, 1);
        return 0;
 }
 
@@ -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;