diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-03-23 10:50:37 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-03-23 10:55:25 -0700 |
commit | 451fc9a8a4a6ad7e85e81e8186a0061da91b37c9 (patch) | |
tree | 8aa8c086f102ed718a07b700cc467b639e9d10cc | |
parent | 7aaa5c0d95c1bcef8a56463fda722bd1baa76fdc (diff) | |
download | c-snippets-451fc9a8a4a6ad7e85e81e8186a0061da91b37c9.tar.gz c-snippets-451fc9a8a4a6ad7e85e81e8186a0061da91b37c9.tar.bz2 c-snippets-451fc9a8a4a6ad7e85e81e8186a0061da91b37c9.zip |
Don't pass negative value to <ctype.h> functions.
-rw-r--r-- | autotab.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -256,14 +256,14 @@ static int fgrep(line_t *list, const char *pattern) int munge_char(int ch) { + if (ch < 0 || isalnum(ch) || ch == '_') + return TOKEN[0]; if (isspace(ch) || iscntrl(ch)) return SPACE[0]; if (strchr("([{<", ch)) return OPGRP[0]; if (strchr(")]}>", ch)) return CLGRP[0]; - if (isalnum(ch) || ch == '_') - return TOKEN[0]; return PUNCT[0]; } |