diff options
Diffstat (limited to 'common/eeprom/eeprom_field.c')
-rw-r--r-- | common/eeprom/eeprom_field.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/common/eeprom/eeprom_field.c b/common/eeprom/eeprom_field.c index f56eebe679f..64b9db18c25 100644 --- a/common/eeprom/eeprom_field.c +++ b/common/eeprom/eeprom_field.c @@ -6,7 +6,8 @@ * Igor Grinberg <grinberg@compulab.co.il> */ -#include <common.h> +#include <stdio.h> +#include <vsprintf.h> #include <linux/string.h> #include <eeprom_field.h> @@ -55,8 +56,8 @@ static int __eeprom_field_update_bin(struct eeprom_field *field, tmp[k] = value[reverse ? i - 1 + k : i + k]; } - byte = simple_strtoul(tmp, &endptr, 0); - if (*endptr != '\0' || byte < 0) + byte = simple_strtoul(tmp, &endptr, 16); + if (*endptr != '\0') return -1; field->buf[j] = byte; |