Otherwise we'll overflow the buffer if space is tight. Also add a comment explaining this.
Signed-off-by: David Zeuthen <davidz@redhat.com>
l = util_strpcpyl(&s, l, key, "=", udev_list_entry_get_value(list_entry), NULL);
if (l == 0)
return -EINVAL;
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 */
}
udev_device->envp[i] = NULL;
udev_device->monitor_buf_len = s - udev_device->monitor_buf;
}
udev_device->envp[i] = NULL;
udev_device->monitor_buf_len = s - udev_device->monitor_buf;