im-tomu / toboot

Bootloader for the EFM32HG Tomu Board
https://tomu.im/
GNU General Public License v3.0
72 stars 28 forks source link

Do not include terminating null characters in string descriptors. #46

Closed lealanko-rt closed 5 years ago

lealanko-rt commented 5 years ago

As per the USB specification (USB1.1, 9.6.5), do not include the terminating null character of a C string literal in the length of a string descriptor.

This only affects the length of the descriptor as sent. The now-superfluous terminating null characters are still allocated. This too could be fixed (with some ugly macros), but that would be a separate space optimization.