On 12/29/10 05:17 PM, Daniel Stone wrote:
> InputAttributes wants non-const members, and while it appears safe to
> cast it, just leave it be for the moment.
> 
> Signed-off-by: Daniel Stone <[email protected]>
> Reviewed-by: Dan Nicholson <[email protected]>
> ---
> 
> v2: v1 was somewhat broken, and missing NULL checks around the 
> newly-introduced
> strdups.  Oops.
> 
>  config/udev.c |   16 +++++++++++-----
>  1 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/config/udev.c b/config/udev.c
> index 496bfbf..01e8293 100644
> --- a/config/udev.c
> +++ b/config/udev.c
> @@ -103,7 +103,8 @@ device_added(struct udev_device *udev_device)
>              LOG_PROPERTY(ppath, "NAME", name);
>          }
>  
> -        attrs.pnp_id = udev_device_get_sysattr_value(parent, "id");
> +        if (attrs.pnp_id)
> +            attrs.pnp_id = strdup(udev_device_get_sysattr_value(parent, 
> "id"));

Is that right?   If it's not NULL, then overwrite the existing pointer?

-- 
        -Alan Coopersmith-        [email protected]
         Oracle Solaris Platform Engineering: X Window System

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to