From 43c0145200bfe06f680ed4ee68177c0a064637a0 Mon Sep 17 00:00:00 2001 From: Steve Markgraf Date: Sun, 4 Nov 2012 15:57:34 +0100 Subject: [PATCH] rtl_eeprom: clean up get_string_descriptor() Signed-off-by: Steve Markgraf --- src/rtl_eeprom.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rtl_eeprom.c b/src/rtl_eeprom.c index 72fb6ce..35191de 100644 --- a/src/rtl_eeprom.c +++ b/src/rtl_eeprom.c @@ -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)