Use isdigit() rather than character range comparisons

This is safer and guaranteed to work with even exotic character sets.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2012-01-18 15:32:48 -06:00
parent 7b1a86b893
commit b426488e2b
1 changed files with 1 additions and 1 deletions

View File

@ -1085,7 +1085,7 @@ off_t _alpm_strtoofft(const char *line)
errno = 0;
/* we are trying to parse bare numbers only, no leading anything */
if(line[0] < '0' || line[0] > '9') {
if(!isdigit((unsigned char)line[0])) {
return (off_t)-1;
}
result = strtoull(line, &end, 10);