Fix incorrect uses of ctype.h (passing it uncast chars, or other

things potentially not in the range 0..255).

[originally from svn r8922]
This commit is contained in:
Simon Tatham
2010-04-17 13:27:15 +00:00
parent 945d8f0a3a
commit 0a9b0a7384
4 changed files with 4 additions and 4 deletions

View File

@ -324,7 +324,7 @@ static char n2c(int num) {
}
static int c2n(char c) {
if (isdigit(c))
if (isdigit((unsigned char)c))
return (int)(c - '0');
else if (c >= 'a' && c <= 'z')
return (int)(c - 'a' + 10);