From: Dean Camera Date: Tue, 7 Jan 2014 23:51:48 +0000 (+1100) Subject: Fix USB_STRING_DESCRIPTOR() macro reported length to account for the null-terminator. X-Git-Tag: LUFA-140302~9 X-Git-Url: http://git.linex4red.de/pub/USBasp.git/commitdiff_plain/578976788971c370ba61aa7fd20530d05319c2d9 Fix USB_STRING_DESCRIPTOR() macro reported length to account for the null-terminator. --- diff --git a/LUFA/Drivers/USB/Core/StdDescriptors.h b/LUFA/Drivers/USB/Core/StdDescriptors.h index 624f3dea3..d611bf37f 100644 --- a/LUFA/Drivers/USB/Core/StdDescriptors.h +++ b/LUFA/Drivers/USB/Core/StdDescriptors.h @@ -91,7 +91,7 @@ * * \param[in] String String to initialize a USB String Descriptor structure with. */ - #define USB_STRING_DESCRIPTOR(String) { .Header = {.Size = sizeof(String), .Type = DTYPE_String}, .UnicodeString = String } + #define USB_STRING_DESCRIPTOR(String) { .Header = {.Size = (sizeof(String) - 2), .Type = DTYPE_String}, .UnicodeString = String } /** Convenience macro to easily create \ref USB_Descriptor_String_t instances from an array of characters. *