Le 23/03/2011 17:10, Ludovic Rousseau a écrit :
> Mail sent too soon.
>
> 2011/3/23 Ludovic Rousseau<ludovic.rouss...@gmail.com>:
>> file ./src/libopensc/pkcs15-oberthur.c around line 654:
>>
>>         if (len)   {
>>                 len>  sizeof(cobj.label) - 1 ? sizeof(cobj.label) - 1 : len;
>>                 memcpy(cobj.label, info_blob + offs + 2, len);
>>         }
>>
>> Can someone tell me what the line starting by "len>  sizeof" is doing?
>>
>> I guess the correct line is:
>>                 len = len>  sizeof(cobj.label) - 1 ? sizeof(cobj.label) - 1 
>> : len;
>>
>> but I am not sure.
>>
>> An even more readable version would be:
>> if (len>  sizeof(cobj.label) - 1)
> if (len>  sizeof(cobj.label) - 1)
>      len = sizeof(cobj.label) - 1;

This more readable version is fine.

-- 
Viktor Tarasov  <viktor.tara...@opentrust.com>

_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to