Am Mittwoch, 4. Januar 2006 23:27 schrieb Greg KH:
> +static ssize_t usblp_show_ieee1284_id(struct device *dev, struct 
> device_attribute *attr, char *buf)
> +{
> +       struct usb_interface *intf = to_usb_interface(dev);
> +       struct usblp *usblp = usb_get_intfdata (intf);
> +
> +       if (usblp->device_id_string[0] == 0 &&
> +           usblp->device_id_string[1] == 0)
> +               return 0;
> +
> +       return sprintf(buf, "%s", usblp->device_id_string+2);

This will work only if there are no 0x00 in the string. Is that always the
case? Would a memcpy be better?

        Regards
                Oliver


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to