mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-30 17:50:16 +01:00
terminal: Don't crash on non-ascii chars
isalpha() and isdigit() don't like huge values. Noticed with ascii-art in the shell prompt.
This commit is contained in:
parent
5626d34d63
commit
552d12b10e
1 changed files with 3 additions and 0 deletions
|
|
@ -2268,6 +2268,9 @@ static int wordsep(int ch)
|
|||
{
|
||||
const char extra[] = "-,./?%&#:_=+@~";
|
||||
|
||||
if (ch > 127)
|
||||
return 1;
|
||||
|
||||
return ch == 0 || !(isalpha(ch) || isdigit(ch) || strchr(extra, ch));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue