The parsing routines for Kconfig files use strtol(), but store and
render values as int. Switch types and formating to long to support a
wider range of values. For example, 0x80000000 wasn't representable.
Signed-off-by: Kees Cook <keescook@chromium.org>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
-static int sym_get_range_val(struct symbol *sym, int base)
+static long sym_get_range_val(struct symbol *sym, int base)
{
sym_calc_value(sym);
switch (sym->type) {
{
sym_calc_value(sym);
switch (sym->type) {
static void sym_validate_range(struct symbol *sym)
{
struct property *prop;
static void sym_validate_range(struct symbol *sym)
{
struct property *prop;
char str[64];
switch (sym->type) {
char str[64];
switch (sym->type) {
return;
}
if (sym->type == S_INT)
return;
}
if (sym->type == S_INT)
- sprintf(str, "%d", val2);
+ sprintf(str, "%ld", val2);
- sprintf(str, "0x%x", val2);
+ sprintf(str, "0x%lx", val2);
sym->curr.val = strdup(str);
}
sym->curr.val = strdup(str);
}
bool sym_string_within_range(struct symbol *sym, const char *str)
{
struct property *prop;
bool sym_string_within_range(struct symbol *sym, const char *str)
{
struct property *prop;
switch (sym->type) {
case S_STRING:
switch (sym->type) {
case S_STRING: