mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2024-11-10 04:37:37 +01:00
rtl_eeprom: clean up get_string_descriptor()
Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
parent
d3c9015d26
commit
43c0145200
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user