rtl_eeprom: clean up get_string_descriptor()

Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
Steve Markgraf 2012-11-04 15:57:34 +01:00
parent d3c9015d26
commit 43c0145200

View File

@ -98,12 +98,12 @@ int get_string_descriptor(int pos, uint8_t *data, char *str)
if (data[pos + 1] != 0x03)
fprintf(stderr, "Error: invalid string descriptor!\n");
for(i = 0; i < (len - 2); i += 2)
str[j++] = data[pos + 2 + i];
for (i = 2; i < len; i += 2)
str[j++] = data[pos + i];
str[j] = 0x00;
return pos + i + 2;
return pos + i;
}
int set_string_descriptor(int pos, uint8_t *data, char *str)