changeset 96:94df2951d118

USBLib: fix USB string descriptor retrieval
author Ivo Smits <Ivo@UCIS.nl>
date Thu, 26 Jun 2014 21:04:20 +0200
parents ebdff34b9e4f
children d8bd5b4ba4d5
files USBLib/Descriptor/UsbDescriptor.cs
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/USBLib/Descriptor/UsbDescriptor.cs	Thu Jun 26 18:45:56 2014 +0200
+++ b/USBLib/Descriptor/UsbDescriptor.cs	Thu Jun 26 21:04:20 2014 +0200
@@ -48,7 +48,7 @@
 			return Encoding.Unicode.GetString(buffer, offset + 2, slen - 2);
 		}
 		public static String GetStringFromDevice(IUsbInterface device, byte index, short langId) {
-			Byte[] buff = new Byte[256];
+			Byte[] buff = new Byte[255];
 			int len = device.GetDescriptor((Byte)UsbDescriptorType.String, index, langId, buff, 0, buff.Length);
 			if (len == 0) return null;
 			return GetString(buff, 0, len);