From 451fc9a8a4a6ad7e85e81e8186a0061da91b37c9 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 23 Mar 2016 10:50:37 -0700 Subject: Don't pass negative value to functions. --- autotab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autotab.c b/autotab.c index 278c568..93c3500 100644 --- a/autotab.c +++ b/autotab.c @@ -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]; } -- cgit v1.2.3