struct sDescriptor_String str;
int src_len, new_len;
char *ret;
+
+ if(Index == 0) return strdup("");
USB_int_ReadDescriptor(Dev, Endpoint, 3, Index, sizeof(str), &str);
+ if(str.Length < 2) {
+ Log_Error("USB", "String %p:%i:%i:%i descriptor is undersized (%i)",
+ Dev->Host, Dev->Address, Endpoint, Index, str.Length);
+ return NULL;
+ }
// if(str.Length > sizeof(str)) {
// // IMPOSSIBLE!
// Log_Error("USB", "String is %i bytes, which is over prealloc size (%i)",