[PATCH v2 3/4] udev: Add strdups to kill const warnings

Daniel Stone daniel at fooishbar.org
Thu Dec 30 05:07:48 PST 2010


On Wed, Dec 29, 2010 at 06:03:51PM -0800, Alan Coopersmith wrote:
> On 12/29/10 05:17 PM, Daniel Stone wrote:
> > --- 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?

Erm ... that'll learn me to send out 'obviously correct' patches at 1am.
Good catch. :)

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101230/b0b22759/attachment.pgp>


More information about the xorg-devel mailing list