Skip to content

Commit

Permalink
do not allow negative indexes for char tables
Browse files Browse the repository at this point in the history
Because char can be signed
  • Loading branch information
Aliaksey Kandratsenka committed Jan 19, 2014
1 parent 27571b1 commit e3aca61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scorer.c
Expand Up @@ -71,13 +71,13 @@ void prepare_scorer(void)
static inline
int delimiter_p(char ch)
{
return delimiter_table[ch];
return delimiter_table[(unsigned char)ch];
}

static inline
char normalize_char(char ch, unsigned *is_delimiter)
{
ch = tolower_table[ch];
ch = tolower_table[(unsigned char)ch];
if (is_delimiter)
*is_delimiter = delimiter_p(ch);
return ch;
Expand Down

0 comments on commit e3aca61

Please sign in to comment.