Commit 1a05465f authored by Adam Wujek's avatar Adam Wujek 💬

scripts: fix crashing menuconfig on target

When running make menuconfig from /wr/etc, mconf was crashing when dialog box
in the style of radiolist was displayed and special keys (like arrow keys)
were pressed. Crash was due to assetion in function toupper from uClibc.
Function to upper should return unchanged value if passed parameter is not
alpha. However, uClibc's implementation behaves in the different way,
it asserts.
After assert following message was printed:
(./mconf: libc/misc/ctype/ctype.c: 320: toupper:
Assertion `((((unsigned int)((c) - 0)) <= ((127 * 2 + 1) - 0)) ||
((c) == (-1)))' failed.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent acfcf9d5
......@@ -204,7 +204,12 @@ do_resize:
for (i = 0; i < max_choice; i++) {
item_set(i + scroll);
if (toupper(key) == toupper(item_str()[0]))
/*
* uClibc's function toupper asserts for items outside <0,255>
* Let's ignore these keys, they're not in strings anyway.
*/
if ((key >= 0) && (key <= 255) && (toupper(key) == toupper(item_str()[0])))
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment