From b426488e2b1cf4e464f7f56dbcf2629a3a73a54a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 18 Jan 2012 15:32:48 -0600 Subject: Use isdigit() rather than character range comparisons This is safer and guaranteed to work with even exotic character sets. Signed-off-by: Dan McGee --- lib/libalpm/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libalpm/util.c') diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index ad15d937..2d0153e5 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -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); -- cgit v1.2.3-24-g4f1b