]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Avoid checking for too large values in parse_unsigned
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 13 May 2012 16:46:39 +0000 (18:46 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 13 May 2012 16:46:39 +0000 (18:46 +0200)
It's not worth the portability hassle

conf.c

diff --git a/conf.c b/conf.c
index d9fb78f139cb83ebbac8ca5029d95590c00781ec..a971b6f14fb781ee721e29000d8759a70387dbd5 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -142,8 +142,7 @@ parse_unsigned(const char *str, void *result, char **errmsg)
        char *endptr;
        errno = 0;
        x = strtol(str, &endptr, 10);
-       if (errno == 0 && x >= 0 && x <= (long)UINT_MAX && *str != '\0'
-           && *endptr == '\0') {
+       if (errno == 0 && x >= 0 && *str != '\0' && *endptr == '\0') {
                *value = x;
                return true;
        } else {