Gerd Hoffmann <kra...@redhat.com> writes:

>> +/*
>> + * ObjectInfo dataset received from initiator
>> + * Fields we don't care about are ignored
>> + */
>> +typedef struct {
>> +    char __pad1[4];
>
> So, is this really padding or a field we don't care about?
>
> If the latter I'd suggest to give them proper names nevertheless,
> maybe append /* unused */.
>

Ok, will do.

>> +static void utf16_to_str(uint8_t len, uint16_t *arr, char *name)
>> +{
>> +    int count;
>> +
>> +    for (count = 0; count < len; count++) {
>> +        /* Check for valid ascii */
>> +        assert(!(arr[count] & 0xFF80));
>> +        name[count] = arr[count];
>> +    }
>> +}
>
> This should do the reverse of usb_mtp_add_str, i.e. first copy uint16_t
> array to wchar_t array, then use wcstombs to translate it into a
> (multi-)byte string of the current locale.

Ah, this is what I was missing. Thank you for the tip, will fix in the next
version.

Bandan

> cheers,
>   Gerd

Reply via email to