diff options
author | Dan McGee <dan@archlinux.org> | 2012-01-18 15:32:48 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-01-18 15:32:48 -0600 |
commit | b426488e2b1cf4e464f7f56dbcf2629a3a73a54a (patch) | |
tree | 72f4421aec4f3ad8e5f42af475724c9e24dee8d1 /lib/libalpm | |
parent | 7b1a86b8939f59693f8bb0ea0454a702d5e2434e (diff) | |
download | pacman-b426488e2b1cf4e464f7f56dbcf2629a3a73a54a.tar.xz |
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.c | 2 |
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); |