chiark / gitweb /
shared: "max" in the string->number conversion is meant to be inclusive
authorMichal Schmidt <mschmidt@redhat.com>
Tue, 30 Oct 2012 14:45:50 +0000 (15:45 +0100)
committerMichal Schmidt <mschmidt@redhat.com>
Tue, 30 Oct 2012 14:46:49 +0000 (15:46 +0100)
src/shared/util.h

index ca80bfe2e8c520d0c844d1491e58d21714d226e5..284035c33b15703354319caf72719bbb1bb7ec33 100644 (file)
@@ -339,7 +339,7 @@ unsigned long long random_ull(void);
                         if (name##_table[i] &&                          \
                             streq(name##_table[i], s))                  \
                                 return i;                               \
                         if (name##_table[i] &&                          \
                             streq(name##_table[i], s))                  \
                                 return i;                               \
-                if (safe_atou(s, &u) >= 0 && u < max)                   \
+                if (safe_atou(s, &u) >= 0 && u <= max)                  \
                         return (type) u;                                \
                 return (type) -1;                                       \
         }                                                               \
                         return (type) u;                                \
                 return (type) -1;                                       \
         }                                                               \