PERFORCE change 161423 for review

Sylvestre Gallon ccna.syl at gmail.com
Fri May 1 11:28:50 UTC 2009


On Fri, May 1, 2009 at 10:24 AM, Hans Petter Selasky <hselasky at c2i.net> wrote:
>>  int
>>  libusb_get_string_descriptor_ascii(libusb_device_handle * dev,
>>      uint8_t desc_index, unsigned char *data, int length)
>> @@ -207,6 +208,8 @@
>>               return (LIBUSB20_ERROR_NO_MEM);
>>
>>       pdev = dev->os_priv;
>> -     return (libusb20_dev_req_string_simple_sync(pdev, desc_index,
>> -         data, length));
>> +     if (libusb20_dev_req_string_simple_sync(pdev, desc_index,
>> +         data, length) == 0)
>> +             return (length);
>> +     return (LIBUSB_ERROR_OTHER);
>>  }
>
> I think the correct here is to return strlen(data) in the successful case,
> because it is quite common that the software will pass in a fixed size
> buffer, while the actual string will be shorter.
>
> In other words you will get a short terminated control request on the USB.
>

I will add your fix with my next submit.

Thanks,

-- 
Sylvestre Gallon (http://devsyl.blogspot.com)
Fifth Grade Student @ Epitech & Researcher @ LSE
R&D @ Rathaxes (http://www.rathaxes.org)


More information about the p4-projects mailing list