terminal: Don't crash on non-ascii chars

isalpha() and isdigit() don't like huge values.
Noticed with ascii-art in the shell prompt.
Andre Heider 12 years ago committed by Kristian Høgsberg
parent 5626d34d63
commit 552d12b10e
  1. 3
      clients/terminal.c

@ -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…
Cancel
Save