From: Piotr Dymacz Date: Mon, 29 Aug 2016 09:02:48 +0000 (+0200) Subject: Fix long type support in itest command X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=183dfeb43ca52f13d87890f466008273c9a20e7b;p=oweals%2Fu-boot_mod.git Fix long type support in itest command --- diff --git a/u-boot/common/cmd_itest.c b/u-boot/common/cmd_itest.c index df3f051..805cf12 100644 --- a/u-boot/common/cmd_itest.c +++ b/u-boot/common/cmd_itest.c @@ -70,7 +70,8 @@ extern int cmd_get_data_size(char* arg, int default_size); static long evalexp(char *s, int w) { - long l, *p; + long *p; + long l = 0; /* if the parameter starts with a * then assume is a pointer to the value we want */ if (s[0] == '*') { @@ -80,7 +81,10 @@ static long evalexp(char *s, int w) l = simple_strtoul(s, NULL, 16); } - return (l & ((1 << (w * 8)) - 1)); + if (w < 4) + return l & ((1 << (w * 8)) - 1); + else + return l; } static char * evalstr(char *s)