+// SPDX-License-Identifier: GPL-2.0+
/*
* (C) Copyright 2003
* Tait Electronics Limited, Christchurch, New Zealand
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
/*
l = simple_strtoul(s, NULL, 16);
}
- return l & ((1UL << (w * 8)) - 1);
+ /* avoid overflow on mask calculus */
+ return (w >= sizeof(long)) ? l : (l & ((1UL << (w * 8)) - 1));
}
static char * evalstr(char *s)
i++;
}
s[i] = 0;
- return getenv((const char *)&s[2]);
+ return env_get((const char *)&s[2]);
} else {
return s;
}