Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-01-18 15:32:48 -0600
committerDan McGee <dan@archlinux.org>2012-01-18 15:32:48 -0600
commitb426488e2b1cf4e464f7f56dbcf2629a3a73a54a (patch)
tree72f4421aec4f3ad8e5f42af475724c9e24dee8d1 /lib/libalpm
parent7b1a86b8939f59693f8bb0ea0454a702d5e2434e (diff)
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>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/util.c2
1 files changed, 1 insertions, 1 deletions
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);